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.

Parameter (integer) to wire assignment

Status
Not open for further replies.

bachok83

Newbie level 2
Joined
Dec 17, 2006
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,299
verilog set wire to parameter

is there any way i can set values to wire from parameter value (in verilog)?

say in VHDL, i can easily use conv_std_logic_vector function.

I tried setting it right away, eg

parameter bla = 10;
wire [6:1] thewire;

assign thewire = bla+5;

that works, but synthesizer complains (warns) about truncated value as bla+5 is tracked as integer32. Is there any other way to do this?
 

where parameter int()

I think you can neglect the warning. The lower bits will be assigned properly.
 

parameter integer

parameter bla = 'd10;
wire [6:1] thewire;

assign thewire = bla + 'd5;

The above changes should remove u r warning.Let me know if it doesn't work
 

erk, unfortunately that doesnt work either.

by doesnt work, i mean the synthesizer whines about it still.

I would love to ignore the warning, but i am implementing a lookup table using case, where there are 64 cases, 64 lines of warnings for just a single module.

another question is, when i use case in vhdl, synthesizer will synthesize them to few big muxes (this is proper), however case in verilog will synthesize into latches.

The reason for latches is verilog wants a variable type object to be on the left side,

reg [5:0] some;

always @ (input)
case (input)
4'b0000 : some = ..............
 

try this out,

parameter bla = 4'b10; //any width as u want to limit to
wire [6:1] thewire;
assign thewire = bla+3'b5;
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top