相当于Verilog文件中系统Verilog打包的输入输出

问题描述 投票:0回答:1

我有一个如下所述的系统Verilog文件

module bist_wrapper 
(

input wire clk_mbist;
output wire BIST_GO_ts3,
  output  mbist_hsm_p::mbist_in_hsm_sysram_t  mbist_in,
  input   mbist_hsm_p::mbist_out_hsm_sysram_t mbist_out
);

 assign mbist_in.clk_mbist = clk_mbist;
 assign BIST_GO_ts3 = mbist_out.BIST_GO_ts3;
endmodule 

我需要创建与系统verilog文件等效的verilog文件,但是如何将系统verilog打包的输入输出作为verilog输入输出处理

下面的文件正确吗?我需要在这里声明“电线”吗?



module bist_wrapper (
clk_mbist, BIST_GO_ts3,mbist_in, mbist_out);

input clk_mbist;
output BIST_GO_ts3;

output  mbist_hsm_p::mbist_in_hsm_sysram_t  mbist_in;
  input   mbist_hsm_p::mbist_out_hsm_sysram_t mbist_out;

assign mbist_in.clk_mbist = clk_mbist;
 assign BIST_GO_ts3 = mbist_out.BIST_GO_ts3;
endmodule 

verilog system-verilog
1个回答
0
投票
文件类型。vh

typedef reg[3:0] out_t;

文件b.v

module b(in,out); `include "types.vh" output out_t out; ... endmodle
因此,您需要将包的内容放在一个单独的文件中,并将其包含在var声明之前。 
© www.soinside.com 2019 - 2024. All rights reserved.