潮声隔雨深 · 2020年02月23日

cortex M3 designstart

I put two slaves on system AHB bus , one is leds the other is switch .

I can write date to the leds' register to control the led on or off, but I can't read date from the switch data register .

i don't know what's wrong

here is the slave's code


//Transfer Response
assign HREADYOUT = 1'b1; //Single cycle Write & Read. Zero Wait state operations

//read
always @(*)
begin
if( rHADDR==(`SWITCH_BASE ))
HRDATA <= {22'h0000_00,rSW};
end

1 个回答 得票排序 · 时间排序
一知半解 · 2020年02月23日

I would suggest you try to dump your waveform and check whether the transfer has been issued out from the interconnect to your targeted slave correctly, e.g. switch data register. If it has been issued to the target slave correctly, then you can check why your switch data register has not response.

From your above limited information, it's difficult to find the reason. But when the slave responses out the read data, it should check whether it's a valid access to this slave by checking HTRANS, check its access type by HBURST, check its access size by HSIZE, etc.

At the same time, as AHB protocol is pipeline, each slave also needs to check whether there is wait status of previous stage from other slaves.

你的回答