当前位置:网站首页>Connection design and test platform -- Summary of SystemVerilog interface knowledge points
Connection design and test platform -- Summary of SystemVerilog interface knowledge points
2022-07-28 17:28:00 【Don't make any more errors】
1、 Why do I need an interface ?
stay SystemVerilog in , In order to simplify the connection between modules 、 With the complexity of the design of a large number of ports 、 Repeated declaration and connection of signals at different design levels , utilize The interface acts as a communication module between blocks To achieve this goal .
advantage : Concise and not easy to make mistakes , When adding a new signal, you only need to change the module of the interface .
2、 What is an interface ?
It is a structure that represents a bundle of wires , Code with intelligent synchronization and connection function .( According to my own understanding , It is equivalent to putting the ports between the two modules in the same structure , Avoid repeated statements )
for example : If interface is not used , Both the arbiter and the test platform need to declare for the same signal . as follows
// Arbiter model using ports
module arb_port(input logic[1:0] grant,output logic[1:0] request...);
// In the test platform using ports , You also need to define ports for the same signal
module test(input logic[1:0] grant,output logic[1:0] request...)3、 Specifically, how to use interfaces to replace ?--interface
// for example , Simple interface of arbiter
interface arb_if(input bit clk);
logic [1:0] grant,request;
logic rst;
endinterface
// Arbiter with simple interface
module arb(arb_if arbif);
...
always @(posedge arbif.clk or posedge arbif.rst) // Can be called directly
begin
...
endmoduleObvious , After defining the interface, there is no need to set the interface in the arbiter module The statement is made. , The call of signal can be directly used . Add the port name .( for example :.clk)( I think it's like adjusting an attribute value )

notes : The clock can be part of the interface or an independent port , And the shorter the instance name of the interface, the better , Easy to quote . It is worth noting that , Interface signals must be driven using non blocking assignment .
4、 Use modport Group the signals in the interface and specify the direction
for example :
interface arb_if(input bit clk);
logic [1:0] grant,request;
logic rst;
modport TEST(output request,rst,input grant,clk);
// This declares the direction of the signal
...
endinterface
// Corresponding , In the use of the test platform , It needs to be indicated at the head of the module , There is no need to specify
module test (arb_if.TEST arbif);边栏推荐
- Introduction to vscade interface
- Verilog daily question (vl14 vending machine 1 -- FSM common question types)
- 【CDH】通过 ClouderaManager 配置CDH组件用 prometheus 监控采集JMX信息
- Verilog 每日一题 (VL5 信号发生器)
- 一文了解 Kubernetes 中的服务发现
- Steps to configure V530 switch
- Application system log structure of elastic stack
- Using SQL server agent job to restore the database regularly
- Goweb开发之Beego框架实战:第四节 数据库配置及连接
- LNMP源码编译安装
猜你喜欢

Verilog 每日一题(VL4 移位运算与乘法)

Azure Devops developed by visual studio 2015 team

Steps to configure V530 switch

Verilog daily question (vl28 plus and minus counter)

Round 1C 2022 - Code jam 2022 b.square (Mathematics, thinking)

Classroom attendance system based on QT design (using RDS for MySQL cloud database)

Goweb开发之Beego框架实战:第四节 数据库配置及连接

Shell脚本之AWK

Visual Studio 2015 团队开发之Azure DevOps篇

【atlas】atlas 编译报错整理(全)
随机推荐
Jupyter notebook win installation record
Visual Studio 2015 团队开发之Azure DevOps篇
2021年4月份自考
Shell脚本之免交互操作
DGL Chapter 1 (official tutorial) personal notes
利用SQL Server代理作业对数据库进行定时还原
Educational codeforces round 126 (rated for Div. 2) f.teleporters (two sets and two points)
Selection and application of capacitor in high speed circuit -- detailed explanation
C # traversal set
Verilog 每日一题(VL8 使用generate…for语句简化代码)
Encountered.Sqlite file processing during Android Development
Linear algebra and matrix theory (10)
Verilog daily question (vl6 data series to parallel circuit)
侦察机与预警机的区别
堡垒机的作用
UNIQUE VISION Programming Contest 2022(AtCoder Beginner Contest 248)G. GCD cost on the tree
Use Alibaba cloud's free SSL certificate
Goweb开发之Beego框架实战:第三节 程序执行流程分析
Message Passing for Complex Question Answering over Knowledge Graphs
微服务架构-服务注册中心和服务网关(6.8) (转载)