[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gEDA-user: icarus and dual-port rams
I get the following errors when trying to compile a dual-ported ram in
icarus. I'm sure my syntax must be bad somewhere, but I can't see
where.
duram.v:31: internal error: The indices are not constant for array ``ram''.
duram.v:36: error: Could not find variable ``ram'' in ``duram''
duram.v:37: error: Unable to bind wire/reg/memory `ram' in `duram'
duram.v:43: error: Could not find variable ``ram'' in ``duram''
duram.v:44: error: Unable to bind wire/reg/memory `ram' in `duram'
5 error(s) during elaboration.
The code follows:
module duram
(data_a,
data_b,
wren_a,
wren_b,
address_a,
address_b,
clock_a,
clock_b,
q_a,
q_b);
parameter DATA_WIDTH = 32;
parameter ADDR_WIDTH = 5;
localparam ADDR_DEPTH = 2**ADDR_WIDTH;
input [DATA_WIDTH-1:0] data_a;
input wren_a;
input [ADDR_WIDTH-1:0] address_a;
input clock_a;
output reg [DATA_WIDTH-1:0] q_a;
input [DATA_WIDTH-1:0] data_b;
input wren_b;
input [ADDR_WIDTH-1:0] address_b;
input clock_b;
output reg [DATA_WIDTH-1:0] q_b;
reg [DATA_WIDTH-1:0] ram [0:ADDR_DEPTH-1];
always @(posedge clock_a)
begin
if(wren_a)
ram[address_a] <= data_a;
q_a <= ram[address_a];
end
always @(posedge clock_b)
begin
if(wren_b)
ram[address_b] <= data_b;
q_b <= ram[address_b];
end
endmodule // duram
Thanks,
Matt
_______________________________________________
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user