views:

225

answers:

4

I am getting the warning that:

One or more signals are missing in the sensitivity list of always block.

always@(Address)begin
  ReadData = instructMem[Address];
end

How do I get rid of this warning?

A: 

Add InstructMem to the sensitivity list.

Brian Carlton
+3  A: 

Verilog does not require signal names in the sensitivity list. Use the @* syntax to signify that the always block should be triggered whenever any of its input signals change:

always @* begin 
    ReadData = instructMem[Address]; 
end 
toolic
if I do that then I can't synthesize it :WARNING:Xst:2319 - "InstructionMemory.v" line 20: Signal instructMem in initial block is partially initialized. The initialization will be ignored.ERROR:Xst:902 - "InstructionMemory.v" line 104: Unexpected instructMem event in always block sensitivity list.
EquinoX
That's a strange way to access a memory, anyways. Usually you'd end up doing a synchronous operation on the memory address and r/w ports, then take the result from its output port.That said, I'm not down with the ins and outs of using the memories of FPGAs, if that's what you're at.
Marty
A: 

declare ReadData as a wire instead of a reg and then replace your always block with an assign.

assign ReadData = instructMem[Address];

George
A: 

I am not sure what the declaration of instructMem looks like. Anyway, ReadData = instructMem[address] is going to result in a multiplexer with address being treated as selection logic and instructMem as data lines of the multiplexer using a typical synthesis tool. You would need to put in instructMem in the sensitivity list since whenever this changes so should ReadData.

I tried Icarus, and you anyway cannot do something like always @(instructMem or address) where instructMem has a declaration like reg [7:0] instructMem [255:0] --> implying memory.

Note: do not try to synthesize Verilog memories this way, typically you are supposed to instantiate memory IPs and connect to their ports. Vendors provide memory models for such purposes.

Fanatic23