Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
9 years ago

Error (10028): Can't resolve multiple constant drivers for net <name> at <??>

All, Here is one of my Verilog trial-learning code:

==============================================================

// Verilog learning example
module SRAM_Read_Write_Sync ( nrst, Writeclk, Readclk, EQ, write_addr, read_addr);
    input nrst, Writeclk, Readclk;
    output EQ, write_addr, read_addr;
    // Declare the address counters as 9-bit counters
    reg  write_addr;
    reg  read_addr;
    reg EQ;
    
    // reset address to 0 if NRST goes LO
    always @ (negedge nrst)
    begin
        write_addr = 0;
        read_addr = 0;
    end
    
    // increment Write address
    always @ (posedge Writeclk)
    begin
        write_addr = write_addr + 1;
    end
    // increment Read address
    always @ (posedge Readclk)
    begin
        read_addr = read_addr + 1;
        if (read_addr == write_addr)
            EQ = 1'b1;
        else
            EQ = 1'b0;
    end
endmodule

==================================================================

All, (the text in RED) when I try to use the negative edge of my nrst as a reset for my address counters I get the

Error (10028): Can't resolve multiple constant drivers for net "read_addr[3]" at SRAM_Read_Write_Sync.v(26)

If I remove the RED code it compiles fine.

How should I implement a nrst signal that take precedence over any other signals that reset the address counters?

Thanks,

Keith

13 Replies