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.

Verilog or SystemVerilog signal initialization rule, Mentor: Multiply Driven

Status
Not open for further replies.

legendbb

Member level 1
Joined
Nov 16, 2013
Messages
34
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,516
I used to initialize all my signals in VHDL.

Attempted same thing in Verilog or SystemVerilog.

Code:
logic dut_output_sig = 1'b0;
dut:(.output(dut_output_sig))

But above initialization doesn't seem to work when the signal is used to connect to my dut:eek:utput

Mentor Error: vsim-3839: Variable *, driven via a port connection, is multiply driven.

Dropping the initialization made it work. Which tells me Verilog/SV doesn't have the same init rule as VHDL?

Not sure if there are other GOTCHAs, or if I am taking this right.

Want to listen to experts,

Thanks,:roll:
 

That is correct. A variable is only allowed to have exclusively: one continuous assignment, or any number of procedural assignments. An output is considered a continuous assignment to the the variable in the port connection, and a variable initialization is considered a procedural assignment before time 0. You can't have both.

I'm not sure what you are trying to achieve with the variable initialization. Even if it were allowed, it would immediately be overwritten with the value driven by the output.
 
That is correct. A variable is only allowed to have exclusively: one continuous assignment, or any number of procedural assignments. An output is considered a continuous assignment to the the variable in the port connection, and a variable initialization is considered a procedural assignment before time 0. You can't have both.

I'm not sure what you are trying to achieve with the variable initialization. Even if it were allowed, it would immediately be overwritten with the value driven by the output.

Thanks Dave, I was thinking about posting into Verification Academy and expected your attention. Magically you showed up here too.

Thanks a lot, I just played with SV in ModelSim no particular reason for the initialization.

Thanks again for sharing your knowledge. :thumbsup:
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top