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.

VHDL "subtype range" in Systemverilog?

Status
Not open for further replies.

modelsim62c

Member level 2
Joined
Mar 30, 2007
Messages
43
Helped
7
Reputation
14
Reaction score
4
Trophy points
1,288
Activity points
1,746
localparam in vhdl

Code:
signal my_sig1, my_sig2 : natural range 0 to INIT_CYCLES; --

I want to port some VHDL RTL files to Systemverilog (for synthesis.)
There are a few VHDL subtype-declarations I don't know how to write (directly) in Systemverilog:
positive, negative, natural

Now, I know i can just convert this to 'int', but I'd like to preserve the restricted-range of the original...is this possible?

For now, I've just put in 'dummy placeholders'

Code:
// imprecise substitute for VHDL's natural/positive/negative
typedef int positive; //
typedef int natural;
typedef int negative;

// std_replacement for VHDL's 'boolean' variable
typedef bit boolean;
localparam boolean false = 1'b0;
localparam boolean true = 1'b0;

Is there a better way to do this?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top