码迷,mamicode.com
首页 > 其他好文 > 详细

Verilog 进击之路 - 夯实基础第二节之module framework

时间:2020-01-11 11:43:45      阅读:82      评论:0      收藏:0      [点我收藏+]

标签:display   lis   frame   mat   计划   include   style   task   NPU   

Verilog 进击之路 - 夯实基础第二节之module framework

 

       在掌握Verilog层次化设计风格后,知道一个basic building block 是module , 需要对每个module进行framework设计。module框架的实现需要element和rules的约束.

       如下是实现module的语法要素

       1. element

(1) whitespace:   \b \t \n ignored by verilog

(2) comments:   // or /*      */

(3) operators:    unary binary ternary

(4) Number:    

²  sized and unsized 4’b1111 12’habc 16’d255 23456 ‘hc3 ‘o21

²  X or Z values these values are important for modeling real circuits

²  Negative number -6’d3

²  Strings

2. Data Types

(1) value set:  /0/1/z/x

(2) Nets

(3) Register

(4) Vectors nets and reg can be declared as vectors

(5) integer real and time register

(6) Arrays matrix [2][3]33559 array_4d [0][0][0][0] [15:0] =0

(7) memories  reg [7:0] membyte [0:1023]  1K 8-bits word

(8) parameter

(9) strings

 

3 task and compiler

(1)    $display

(2)    $monitor $monitor持续检测变量或者信号的值,不同于$display.

(3)    $stop

(4)    $finish

 

(1)    `define

(2)    `include

 

  了解完基本的语法规则后,还需要了解模块的定义和framework.

(1)    Module name

(2)    Port list

Port 提供了与外界交互的接口,就提供了很大灵活性给开发者。

根据方向,有Input output inout

规则是:(reg or net)internal unit and external unit(net)

(3)    Port declarations

(4)    Parameters

(5)    Declarations of Wire and regs or variables

(6)    Instantiation of lower level module

(7)    Data flow statements

(8)    Always and initial blocks

从root module 可以利用identifier 去 trace the path , such as TOP_T.stimulus.reset

        以上总结了一个module 的基本元素和实现规则,关键还是要结合项目深深体会。在总结完这部分内容后,我将继续了解module 的重要组成部分,gate level module, dataflow level behavioral model, task and function, useful modle switch level modle UDP 等等。

       总结一下,Verilog项目设计就好像一个帝国征战,有top -down and bottom -up 的优秀作战方略,每个subblock 都是一个集团军,互相配合完成作战任务,每个subblock下都有若干个module主力师。面对元帅下达的任务Spec,每个module实现的任务都很明确。如何实现module主力师的任务,就需要各个团,比如gate level module 团,UDP module团等等互相协作完成。我们一方面要当元帅,制定详细,合理的作战计划,也要深入到每个团,每个连去合理分配兵力,调兵遣将。下节我们就开始了解每个主力师module下的各团UDP/dataflow等等的配置。

Verilog 进击之路 - 夯实基础第二节之module framework

标签:display   lis   frame   mat   计划   include   style   task   NPU   

原文地址:https://www.cnblogs.com/dcj-study/p/12179125.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!