Hi,
I have recently experimented with a MOD54415 to communicate with an FPGA via a 32-bit and 8-bit bus. While there is an on-board latch, it is not exposed externally and is used just for interfacing with on-board flash. This latch should have no noticeable effect on the bus when interfacing with external chip-selects.
The CSCR setting I wound up using for 32-bit mode was:
sim2.cs[1].cscr= 0x00150D00;
I did not do extensive stability testing with these settings and you may need longer wait states depending on the load on your bus signals.
The tricky part is on the Xilinx side. Normally with an 8-bit/16-bit bus, the lower 24/16-bits of address remain on the bus for the data portion of the bus cycle. With a 32-bit bus that is not possible since there are only 32-bits of bus. That means that you must latch the bus twice, once for the address cycle and once for the data cycle. The problem with this is that the MOD54417 does not bring out the FB_ALE signal to a header in its default hardware configuration. There is a small hardware stuffing modification that can be done to bringout the FB_ALE signal but it is possible to get the bus working without the hardware modification.
The following code snippets are in verilog and has only been used in demo code, it should be vigorously tested before being used in a production environment. The only major draw back to this code is that is latching the address on nearly every clock cycle so it may consume a bit more power then if the FB_ALE was exposed.
Code: Select all
parameter base_addr = 32'h10000000; //base address of external memory
reg [31:0]FB_Address; // register to store latched address
reg [31:0]MyWriteReg ; // Stores data when MOD5441x writes to address 0x10000010
// If the flexbus chip select is inactive or flexbus output enable is inactive
// then we drive nothing on flexbus data line
// otherwise we use function func_FB_Dataout to decide what we drive on flexbus data lines
// Refer to MCF54415 Flexbus chapter for basic bus cycle diagrams
assign { FB_Bus[31:0] } = ( (FB_N_CS1==1) || (FB_N_OE==1) ) ? 32'bz : func_FB_Dataout( FB_Address );
function [31:0] func_FB_Dataout( input [31:0] address );
case ( address[31:0] )
base_addr + 32'h100 : func_FB_Dataout = 32'h01234567; // If reading address 0x10000100 output 0x01234567
base_addr + 32'h104 : func_FB_Dataout = 32'h89ABCDEF; // If reading address 0x10000104 output 0x89ABCDEF
default : func_FB_Dataout = address; // Any other address output the address
endcase
endfunction
// On every clock cycle that the chip select is not enabled, latch the address
// Since the CS is not asserted until after the address cycle, we will always have a latched address at CS assertion
// Once the chip select is active, check if the FPGA is being written to by the MOD5441x at a valid write address and save the data
always @(posedge FB_CLK)
begin
if( FB_N_CS1 == 1 )
begin
FB_Address[31:0] <= FB_Bus[31:0];
end
else if ( FB_RNW == 0 )
begin
case( FB_Address )
base_addr + 32'h010 : MyWriteReg <= FB_Bus; // example of a write operation from the MOD to the FPGA at address 0x10000010
default : ;
endcase
end
end