--- Quote Start ---
I often use initial values on my vhdl signals (instead or in addition to reset) to ease simulation or to just initially specify signals or inferred memory content at power up. Now, if these signals are inputs optionally sourced by some other vhdl code, or even assigned to another signal with a different initial value, things still synth on quartus (no warnings?) and Im left being insecure of what initial value really got used..
Is there any guides on how this works/should work? Plain logic tells me the top level initialization should override any local, but Id like to see that documented.
The reason I ask is first because this always made me wonder, and second that I just cooked some code with dual port mem, where the access ports are in different vhdl code blocks, and the full array is passed between them, and even if I initialize on both sides, it seems to end up with all 0's at power up. It does infer as dual port mem as expected, but Im not sure what I need to do to initialize this. (I havent tried the .mif way, but I'd like to avoid it if I can).
--- Quote End ---
When it comes to synthesis, initial values only apply to registers at power up(& memory cells). Initial values on wires is useless though ModelSim respects them.
setting "powerup don't care' to off can be used to apply default zero powerup for all registers except those with preset values.
using code assignment := at signal declaration is nowadays supported for initial values on registers.
If the signal is not a register then it is ignored.
If you initialise a module input (din) with say zeros then wire it up to another module's output (dout) that is initialised to ones then you need to work out what registers you are going to get. Are you going to get two pairs one labelled din and the other dout? No
dout may be register but din does not refer to a different register. Even if you register din directly to din_r what you get is:
dout_reg => din => din_r_reg
As you can see the register is named by its output, not its input. So in above example I will assume the output initial value of ones will take over and din will acquire it as it wired to it. You can try it yourself in quartus and tell us.