Consider reg A,B
How to declare the address for this register as 100,110?
Consider reg A,B
How to declare the address for this register as 100,110?
In reply to Design Engineer:
I thought this question was previously answered.
Is this what you meant?
// Consider 2 register namely A,B
// I need to define the address for the register as 0x102,0x104
module m(input logic clk, rd, wr,
input logic[15:0] addr, data,
output logic[15:0]data_out);
logic[15:0] A, B;
always @(posedge clk) begin
if(wr && addr==16'H102) A<=data;
if(rd && addr==16'H102) data_out<= A;
if(wr && addr==16'H104) B<=data;
if(rd && addr==16'H104) data_out<= B;
end
endmodule
Ben Cohen
http://www.systemverilog.us/ ben@systemverilog.us
For training, consulting, services: contact Home - My cvcblr