当前位置:网站首页>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);边栏推荐
- Verilog 每日一题(VL8 使用generate…for语句简化代码)
- Analysis of browser decoding process
- Verilog daily question (vl24 multi bit MUX synchronizer cross time domain output)
- Verilog 每日一题(VL14 自动贩售机1--FSM常见题型)
- Visual Studio 2015 团队开发之Azure DevOps篇
- LNMP源码编译安装
- 线性代数及矩阵论(七)
- MySQL PgSQL realizes the merging of multiple lines of records into one line, grouping and merging, and dividing with specified characters
- Visual studio 2012/2015 releases web applications together with.Cs source code
- Atcoder beginer contest 240 g.reporting Takahashi (classical problems of Combinatorial Mathematics)
猜你喜欢

kubernetes service 原理解析

连接设计与测试平台——SystemVerilog 接口知识点总结

22年多校第三场(F的证明

Visual Studio 2012/2015发布Web应用连同.cs源码一起发布

Selection of resistance in high speed circuit

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

【atlas】atlas 编译报错整理(全)

Verilog 每日一题 (VL5 信号发生器)

Mysql database addition, deletion, modification and query (detailed explanation of basic operation commands)

零基础利用Unity3D开发AR应用并远程下载3D模型
随机推荐
Kubernetes service and ingress you need to master
Reasoning Over Semantic-Level Graph for Fact Checking
如何在构建阶段保护镜像安全
Analysis of browser decoding process
Verilog 每日一题(VL6 数据串转并电路)
部署LAMP平台---Linux,Apache,MySQL,PHP的编译安装
Vscode界面介绍
The actual combat of the beego framework of goweb development: Section III program execution process analysis
Andthen of function interface
微服务架构-服务注册中心和服务网关(6.8) (转载)
C#遍历集合
Differences between CNSA and CASC and CASIC
What does the service grid that has been popular for two years bring to microservices? (Reprinted)
Soft exam review summary
线性代数及矩阵论(九)
部分情况下Error:(xx, xx) Failed to resolve: xxxxxx解决。
Microservice Architecture - service registry and service gateway (6.8) (Reprint)
线性代数及矩阵论(十)
Using SQL server agent job to restore the database regularly
Verilog daily question (vl26 simple stopwatch)