顶层模块:mix_module

module mix_module

(

CLK, RSTn, Flash_LED, Run_LED

);

input CLK;

input RSTn;

output Flash_LED;

output [2:0]Run_LED;

/**********************************/

//wire Flash_LED;

//reg Flash_LED;

flash_module U1

(

.CLK( CLK ),

.RSTn( RSTn ),

.LED_Out( Flash_LED )

);

/**********************************/

//wire [2:0]Run_LED;

//reg [2:0]Run_LED;

run_module U2

(

.CLK( CLK ),

.RSTn( RSTn ),

.LED_Out( Run_LED )

);

/***********************************/

//assign Flash_LED = Flash_LED;

// assign Run_LED = Run_LED;

/**********************************/

endmodule

子模块1:flash_module

module flash_module

(

CLK, RSTn, LED_Out

);

input CLK;

input RSTn;

output reg LED_Out;

/*********************************/

parameter T50MS = 22'd2_499_999;//DB4CE15使用的晶振为50MHz,50M*0.05-1=2_499_999

/********************************/

reg [21:0]Count1;

always @ ( posedge CLK or negedge RSTn )

if( !RSTn )

Count1 <= 22'd0;

else if( Count1 == T50MS )

Count1 <= 22'd0;

else

Count1 <= Count1 + 1'b1;

/*********************************/

//reg rLED_Out;

always @ ( posedge CLK or negedge RSTn )

if( !RSTn )

LED_Out <= 1'b0;

else if( Count1 == T50MS )

LED_Out <= ~LED_Out;

/*********************************/

//assign LED_Out = rLED_Out;

endmodule

子模块2:run_module

module run_module

(

CLK, RSTn, LED_Out

);

input CLK;

input RSTn;

output [2:0]LED_Out;

/**************************/

parameter T1MS = 16'd49_999;//DB4CE15使用的晶振为50MHz,50M*0.001-1=49_999

/**************************/

reg [15:0]Count1;

always @ ( posedge CLK or negedge RSTn )//1ms计数器

if( !RSTn )

Count1 <= 16'd0;

else if( Count1 == T1MS )

Count1 <= 16'd0;

else

Count1 <= Count1 + 1'b1;

/*****************************************/

reg [9:0]Count_MS;

always @ ( posedge CLK or negedge RSTn )//100ms计数器

if( !RSTn )

Count_MS <= 10'd0;

else if( Count_MS == 10'd100 )

Count_MS <= 10'd0;

else if( Count1 == T1MS )

Count_MS <= Count_MS + 1'b1;

/*********************************/

reg [2:0]rLED_Out;

always @ ( posedge CLK or negedge RSTn )

if( !RSTn )

rLED_Out <= 3'b001;

else if( Count_MS == 10'd100 )

begin

if( rLED_Out == 3'b000 )

rLED_Out <= 3'b001;

else

rLED_Out <= { rLED_Out[1:0], 1'b0 };//向左移位1bit操作

end

/*****************************/

assign LED_Out = rLED_Out;

/*****************************/

endmodule

python verilog顶层连线_FPGA中顶层模块与各子模块之间的连接线类型相关推荐

  1. BBS中父模块缩进,子模块归属父模块的实现方式

    BBS中父模块缩进,子模块归属父模块的实现方式 板块显示顺序问题 在tbl_board表中增加一个显示顺序字段 order alter table tbl_board add ( order_num ...

  2. fpga如何约束走线_FPGA中的CLOCK REGION和SLR是什么含义

    上期内容:FPGA中的BEL, SITE, TILE是什么含义 由BEL到SITE再到TILE,具体内容可看上篇推文,那么TILE之上是什么呢? CLOCKREGION不同类型的TILE按列排列构成了 ...

  3. python的matplotlib背景线_python中matplotlib的颜色及线条 控制

    https://www.cnblogs.com/darkknightzh/p/6117528.html https://blog.csdn.net/qq_34337272/article/detail ...

  4. python中类的属性一般来说_python中实例属性和类属性之间的关系

    匿名用户 1级 2018-06-25 回答 一般来说,在Python中,类实例属性的访问规则算是比较直观的. 但是,仍然存在一些不是很直观的地方,特别是对C++和Java程序员来说,更是如此. 在这里 ...

  5. python 表情包制作工具_python中tkinter模块制作表情包爬取工具遇到的问题

    [Python] 纯文本查看 复制代码import tkinter as tk from tkinter.filedialog import askdirectory import requests ...

  6. SAP ABAP 对话框编程教程:中的模块池-09

    SAP ABAP 对话框编程教程:中的模块池-09 SAP-ABAP 支持两种类型的程序 – 报告程序和对话程序. 如果您的 ABAP 程序需要用户输入 ,则使用对话框编程. 在本教程中,您将学习: ...

  7. python使用matplotlib可视化线图(line plot)、在可视化图像中的指定位置添加横线(add horizontal line in matplotlib plot)

    python使用matplotlib可视化线图(line plot).在可视化图像中的指定位置添加横线(add horizontal line in matplotlib plot) 目录

  8. python使用matplotlib可视化线图(line plot)、并自定义设置可视化图像中没有网格线(remove grid line in matplotlib plot result)

    python使用matplotlib可视化线图(line plot).并自定义设置可视化图像中没有网格线(remove grid line in matplotlib plot result) 目录

  9. python使用matplotlib可视化线图(line plot)、使用arrow函数在matplotlib可视化图像中添加箭头(drawing arrows in matplotlib)

    python使用matplotlib可视化线图(line plot).使用arrow函数在matplotlib可视化图像中添加箭头(drawing arrows in matplotlib) 目录

  10. Vue3组合式Api script setup模式中顶层使用await报Top-level ‘await‘ expressions are only allowed when the ‘module‘

    今天练习Vue3的Suspense组件的时候碰到在Vue3组合式Api script setup模式中顶层使用await时报错Eslint错误(能正常编译),错误提示是: Top-level 'awa ...

最新文章

  1. 华为广域网帧中继(背靠背)配置
  2. 办暂住证,郁闷,极度不爽.
  3. 神经网络 神经元_神经去耦
  4. Java实现快速查找(又名二分查找)
  5. Elasticsearch refresh
  6. 高校375个国家级精品课程
  7. Miracle密码算法开源库(三)分析 :mrarth1.c
  8. 计算机组成部件及其作用,计算机硬件组成成分各自的功能 计算机硬件有哪几部分组成?请分别说明各部分的作用?...
  9. 7月编程排行榜新鲜出炉,再次上演神仙打架!
  10. 怎么装python的keras库_Keras 教程: Python 深度学习终极入门指南
  11. 相机误删照片恢复的步骤是什么?仅需3步,圆满解决
  12. 不会用PS、Excel更改证件照颜色没关系,用Word更改不用1分钟!
  13. Linux学习笔记:DNS
  14. Delphi 2009发布
  15. 41个搜索引擎免费登陆入口大全
  16. STM32F103C8T6与ESP8266构建通信(二)
  17. 算法导论——A*算法易懂的证明
  18. RabbitMQ 详细讲解
  19. ECP认证咨询,ECP自我审核表体现了ECP政策前四个模块的结构和布局
  20. 如何卸载计算机强行安装游戏,如何卸载和重新安装《炉石传说》

热门文章

  1. 1、CSS Float(浮动),2、CSS 布局 - 水平 垂直对齐,3、CSS 伪类(Pseudo-classes),4、导航栏
  2. 36.Linux/Unix 系统编程手册(下) -- 进程资源
  3. 4. Layout overview
  4. 13. Window blur() 方法
  5. eruda手机端调试神器
  6. linux 在后台运行数据库导入导出命令
  7. [Spark]如何设置使得spark程序不输出 INFO级别的内容
  8. 数组元素循环右移问题
  9. UVA 10002 Center of Masses
  10. Android-AlarmManager(全局定时器/闹钟)