L
Luiz Gustavo
Guest
This a part of my code:
//generate bit-counter
always @(posedge clk or posedge rst)
if(rst)begin
bit_cntm <= 3'b111;
mem_adr_master <= 3'b000;
end
else
bit_cntm <= bit_cntm - 3'h1;
//generate access done signal
always @(posedge clk)
ldm <= ~(|bit_cntm);
always @(negedge clk)
if (ldm)
begin
mem_in_master[mem_adr_master] <= srim;
master_out <= mem_in_master[mem_adr_master];
mem_adr_master <= mem_adr_master + 1'b1;
end
And this is the error by Quartus II:
Can't resolve multiple constant drivers for net mem_adr[2] in line
"if(rst)begin".
Constant driver in line "if (ldm)".
When I comment the line "mem_adr_master <= 3'b000;" the code
compilation is well...
Obs.:
reg [2:0] bit_cntm;
reg [2:0] mem_adr_master;
input clk, rst;
reg [7:0] mem_in_master [7:0];
reg [7:0] mem_out_master [7:0];
reg srim;
reg ldm;
Some idea?
Thank's!
//generate bit-counter
always @(posedge clk or posedge rst)
if(rst)begin
bit_cntm <= 3'b111;
mem_adr_master <= 3'b000;
end
else
bit_cntm <= bit_cntm - 3'h1;
//generate access done signal
always @(posedge clk)
ldm <= ~(|bit_cntm);
always @(negedge clk)
if (ldm)
begin
mem_in_master[mem_adr_master] <= srim;
master_out <= mem_in_master[mem_adr_master];
mem_adr_master <= mem_adr_master + 1'b1;
end
And this is the error by Quartus II:
Can't resolve multiple constant drivers for net mem_adr[2] in line
"if(rst)begin".
Constant driver in line "if (ldm)".
When I comment the line "mem_adr_master <= 3'b000;" the code
compilation is well...
Obs.:
reg [2:0] bit_cntm;
reg [2:0] mem_adr_master;
input clk, rst;
reg [7:0] mem_in_master [7:0];
reg [7:0] mem_out_master [7:0];
reg srim;
reg ldm;
Some idea?
Thank's!