You aren't pointing to the
name of the memory array.
Code:
CHORUSROM u1(.clk(Clk2x),.rsta(Reset),.addra(g1),.douta(w2));
$readmemb("chorus.txt",CHORUSROM,0,796);
CHORUSROM is the module name of the u1 isntance. It is not the name of a [12:0] Mem[255:0] array.
Take a look at the following information on using readmenb:
**broken link removed** as you can see the array memory is what is used.
What is wrong with using a core generator ROM? You seem against using it.
Other issues that would preclude having only one error.
1) You are assigning input ports inside the module, which is illegal in Verilog.
Code:
input [10:0] addra1;
input [10:0] addra2;
input [11:0] addra3;
always @(posedge clkdv) begin
if (addra1==800)
addra1=0;
else
addra1=addra1+1;
end
You are also using blocking assignments when you should be using non-blocking assignments (you still need to read and understand the contents of a verilog book) as this is an edge triggered sequential block.
2) You are performing and assignment using assign to a reg type, This is illegal in Verilog.
Code:
reg [10:0]g1,g2;
reg [11:0]g3;
assign g1=addra1;
assign g2=addra2;
assign g3=addra3;
I don't even understand why you would even perform this assignment as it does nothing but change the name of the signal. IMO this is a waste of typing.
3) Still using the mux4to2, which is both poorly named multiplexers have 1 output not 2 and used low level Verilog gates which are defined for scalar values. As you allow for behavioral code at the top level the mux should just be more behavioral code (i.e. a case statement) at the top level.
4) You need to learn how to write self documenting code...tip1 use names that have meaning i.e. names like
w6 don't tell someone what the signal does like the name
enable, which is probably an enable. Lack of comments is a problem too, makes code a maintenance nightmare.
5) Way too many intermediate signal names e.g.
Code:
assign t3=t2 >> 1;
assign w8=t3;
// this should have been one line of code:
assign w8 = t2 >> 1;
and what is this? Wrong! No!, learn Verilog read a book!
Code:
always @(posedge Clk) begin
t1<=w6;
t2<=w6;
[B][I]// What is an assign doing in an edge triggered sequential block, this is plain wrong.[/I]
assign t3=t2 >> 1;[/B]
end
6) You seem to be taking selective forum advice and ignoring the reset, including a lot of the advice I've given you. Why should I continue bothering replying to these posts, if I'm wasting my time? Unless I see
everything in this post being addressed by you I will give up replying as my time is more valuable spent elsewhere.
Regards