当前位置:网站首页>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);边栏推荐
- 高速电路中电容的选型和应用——详解
- Round 1C 2022 - Code jam 2022 b.square (Mathematics, thinking)
- Analysis of browser decoding process
- Verilog daily question (vl26 simple stopwatch)
- Use of influxdb2
- The practice of the beego framework for goweb development: Section V project construction and user registration
- Self study examination in April 2021
- Codeworks round 801 (Div. 2) and epic Institute of technology round D. tree queries (tree DP)
- Visual Studio 2012/2015发布Web应用连同.cs源码一起发布
- Some attention code explanations
猜你喜欢

High speed circuit design practice -- Overview

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

GEAR: Graph-based Evidence Aggregating and Reasoning for Fact Verification

全链路灰度在数据库上我们是怎么做的?

【kibana】问题整理 kibana 7.x No indices match pattern “apm-*“

Firewalld防护墙

Verilog daily question (vl14 vending machine 1 -- FSM common question types)

零基础利用Unity3D开发AR应用并远程下载3D模型

Steps to configure V530 switch

异步电路设计--同步脉冲器原理及例题
随机推荐
Application system log structure of elastic stack
利用SQL Server代理作业对数据库进行定时还原
Difference between reconnaissance aircraft and early warning aircraft
Analysis of browser decoding process
Steps to configure V530 switch
带参数的微信小程序二维码生成
软考回顾总结
With a total data volume of more than trillions of lines, Yuxi cigarette factory can easily deal with it by correctly selecting the timing database
Net framework
Atcoder beginer contest 240 g.reporting Takahashi (classical problems of Combinatorial Mathematics)
配置V530交换机步骤
MySQL detailed learning tutorial (recommended Collection)
Visual studio 2012/2015 releases web applications together with.Cs source code
Why do I choose to use go language?
Verilog 每日一题(VL14 自动贩售机1--FSM常见题型)
Verilog 每日一题(VL26 简易秒表)
The actual combat of the beego framework of goweb development: Section III program execution process analysis
Reasoning Over Semantic-Level Graph for Fact Checking
Janus series article 3 API usage guide videoroom creating a new video room
MySQL数据库增删改查(基础操作命令详解)