Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[Moved] user defined data types in verilog

Status
Not open for further replies.

raghava216

Junior Member level 3
Joined
Mar 10, 2011
Messages
27
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,646
I want to know how to define user defined data type in verilog?

I want to define a two-dimensional array with a name say 'memory' and I want to declare a new variable of type 'memory' and assign values to it...

How to do this?

Plz. help
 

SystemVerilog has user-defined data types, Verilog does not.

In Verilog, you have to repeat the data type every time you use it;

reg [width-1:] memory1 [0:dimension1-1][0:dimension2-1];
reg [width-1:] memory2 [0:dimension1-1][0:dimension2-1];


In SystemVerilog, you use a typedef

typedef logic [width-1:0] memory2d_t [dimension1][dimension2];

memory_t memory1;
memory_t memory2;
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top