上一篇testbench我自己也沒怎麽搞懂,再來一篇學習特權同學的方法。

課程:Lesson 7 BJ EPM240学习板实验1——分频计数实验

鏈接:https://www.youtube.com/edit?o=U&video_id=YbNEKMLUCyI  (科學上網)

前奏:創建工程,蜂鳴器code,引脚配置,編譯,等等忽略

module fp_verilog(clk, rst_n, fm);

    input clk;//時鐘信號,50Mhz
input rst_n;//復位信號,低電平有效
output fm;//蜂鳴器 //assign fm = 1'b0; //測試蜂鳴器是否正常 reg[:] cnt;//位數越小越明顯,我因爲設置大了,simulation了半天 always @(posedge clk or negedge rst_n)
if(!rst_n) cnt <= 'd0;
else cnt <= cnt + 'b1; assign fm = cnt[]; endmodule

開始:Processing --->  Start ---> Star Test Bench Template Writer                  注:可能messages框會説未生成 xxx.vt,導致無法完成下一步。  解決方法:Assignments ---> setting ---> Simulation ---> Tool name ---> ModelSim-Altera

然後:打開生成文檔,修改code    注:我所添加的code已經加粗,其餘請對比修改。

// Copyright (C) 2017  Intel Corporation. All rights reserved.
// Your use of Intel Corporation's design tools, logic functions
// and other software and tools, and its AMPP partner logic
// functions, and any output files from any of the foregoing
// (including device programming or simulation files), and any
// associated documentation or information are expressly subject
// to the terms and conditions of the Intel Program License
// Subscription Agreement, the Intel Quartus Prime License Agreement,
// the Intel MegaCore Function License Agreement, or other
// applicable license agreement, including, without limitation,
// that your use is for the sole purpose of programming logic
// devices manufactured by Intel and sold by Intel or its
// authorized distributors. Please refer to the applicable
// agreement for further details. // *****************************************************************************
// This file contains a Verilog test bench template that is freely editable to
// suit user's needs .Comments are provided in each section to help the user
// fill out necessary details.
// *****************************************************************************
// Generated on "08/07/2017 22:03:54" // Verilog Test Bench template for design : fp_verilog
//
// Simulation tool : ModelSim (Verilog)
// `timescale us/ us //
module fp_verilog_vlg_tst();
// constants
// general purpose registers
reg eachvec;
// test vector input registers
reg clk;
reg rst_n;
// wires
wire fm; // assign statements (if any)
fp_verilog i1 (
// port map - connection between master ports and signals/registers
.clk(clk),
.fm(fm),
.rst_n(rst_n)
); initial
begin
// code that executes only once 只执行一次的代码
// insert code here --> begin 在这里插入代码 - >开始
clk = ;
forever #5 clk = ~
clk;
// --> end
$display("Running testbench");
end initial
  begin
rst_n = ; #1000; rst_n = 1;
#;
$stop;
  end

// always
// // optional sensitivity list 可选灵敏度列表
// // @(event1 or event2 or .... eventn)
// begin
// // code executes for every event on sensitivity list 敏感性列表中的每个事件执行代码
// // insert code here --> begin 在这里插入代码 - >开始
//
// @eachvec;
// // --> end
// end
endmodule

其次:Assignments ---> setting ---> Simulation ---> NativeLink settings ---> Compile test bench ---> Test Benchs  --->  New  ---> 如圖 且添加剛才的文件

最後:Tools --->  Run Simulation Tool  --->  RTL Simulation

證明自己有多懶   (●'◡'●)  :http://convert-units.info/time/microsecond/3000

FPGA學習筆記(肆)--- Star Test Bench Template Writer的更多相关文章

  1. FPGA學習筆記(貳)--- 流水燈

    平臺:FPGA黑金开发板 AX301 開發環境:Quartus Prime Version 17.0.0 Build 595 04/25/2017 Standard Edition 引脚配置:鼠標托拉 ...

  2. [Python學習筆記] 使用xlwings 插入註解 (forked 版本)

    到今天為止 xlwings 還沒有插入註解的功能 去原始開發者的 Github Pull Requests 他說之前有人有建議要加入這個功能 但他還沒更新~ 如果需要使用 Python 來插入註解的話 ...

  3. Java學習筆記(基本語法)

    本文件是以學習筆記的概念為基礎,用於自我的複習紀錄,不過也開放各位的概念指證.畢竟學習過程中難免會出現觀念錯誤的問題.也感謝各位的觀念指證. 安裝JDK 在Oracle網站中找自己系統的JDK下載位置 ...

  4. [DDD]學習筆記 第15章 精煉(Distillation)

    核心領域(Core-Domain) 為了使領域模型成為企業真正的資產, 模型中的關鍵核心部份需要足夠靈活和充分利用來創建應用程序的功能; 簡而言之, 核心領域是系統中最有價值的部份. 濃縮模型, 將最 ...

  5. C# partial 學習筆記

    局部類的講解參考:http://blog.csdn.net/susan19890313/article/details/7575204 感謝作者~

  6. ORACLE 學習筆記

    proc 里的 commit等于提交就是你做了insert或者update后,commit后才是真正修改或者插入了数据库中 如果不提交的话,那么这个表就被锁了 CURSOR MYCURSOR is   ...

  7. [Python學習筆記] 使用 selenium 抓取網頁並且雙擊滑鼠 (double click)

    一開始使用的時候 看官方文件 以為使用 double_click()即可 但後來出現錯誤 AttributeError: 'WebElement' object has no attribute 'd ...

  8. [Python學習筆記] 利用 Python在Excel 插入註解

    用Python 來處理excel 檔 用過了 openpyxl 還有 pyexcel目前覺得除了讀寫如果還要使用另外的功能 (像是讀取格子裡的公式)可以用 xlwings  他的首頁標題 " ...

  9. [Python學習筆記] 抓出msg信件檔裡的附件檔案

    想要把msg信件檔案的附件抓出來做處理,找到了這個Python 模組 msg-extractor 使用十分容易,但是這個模組是要在terminal裡執行,無法直接打在IDLE的編輯器上 所以稍微做了修 ...

随机推荐

  1. ThreeJs 模型的缩放、移动、旋转 以及使用鼠标对三维物体的缩放

    首先我们创建一个模型对象 var geometry = new THREE.BoxGeometry( 100, 100, 100); //边长100的正方体 var material = new TH ...

  2. 如何在Python中调用Matlab

    检查您的系统是否具有受支持的 Python 版本和 MATLAB R2014b 或更新版本.要检查您的系统上是否已安装 Python,请在操作系统提示符下运行 Python. 1)打开Prompt,输 ...

  3. 可视化n次贝塞尔曲线及过程动画演示--大宝剑

    起因 研究css中提供了2次.3次bezier,但是没有对n次bezier实现.对n次的实现有很大兴趣,所以就用js的canvas搞一下,顺便把过程动画模拟了一下. 投入真实生产之中,偏少. n次be ...

  4. wget -r -c -nd

    wget -r -c -nd -r 递归下载 -c 断点续传 -nd 不创建目录, wget默认会创建一个目录 -l1 (L one) 递归一层,只下载指定文件夹中的内容, 不下载下一级目录中的.–n ...

  5. 《DOM Scripting》学习笔记-——第九章 CSS-DOM

    本章内容: 一.style属性 二.如何检索样式信息 三.如何改变样式 属性: 包含位置信息:parentNode , nextSibling , previousSibling , childNod ...

  6. 浅谈openstack中使用linux_bridge实现vxlan网络

    openstack环境: 1 版本:ocata 2 系统:ubuntu16.04.2 3 控制节点 1个 + 计算节点 1个 4 控制节点网卡为ens33,ip = 172.171.5.200 ens ...

  7. tensorflow 升级到1.9-rc0,tensorboard 报错:TypeError: GetNext() takes exactly 1 argument (2 given)

    Exception in thread Reloader:Traceback (most recent call last):  File "/usr/lib/python2.7/threa ...

  8. 阿里云 部署dashboard

    本文是基于kubeasz 进行部署安装,将部署心得记录下来.可以查看原文地址: https://github.com/gjmzj/kubeasz/blob/master/docs/guide/dash ...

  9. keepalived添加服务自启动报错分析

    安装完keepalived后设置为服务自启动 将路径为/usr/local/src/keepalived-1.3.4/keepalived/etc/init.d的文件keepalived拷贝到/etc ...

  10. C#中生成GUID的四种格式

    var uuid = Guid.NewGuid().ToString(); // 9af7f46a-ea52-4aa3-b8c3-9fd484c2af12 var uuidN = Guid.NewGu ...