Forum Discussion
Altera_Forum
Honored Contributor
9 years ago --- Quote Start --- I am also not quite sure which signals of the interfaces I really need. --- Quote End --- Qsys is flexible and it allows you to define your slave and it will generate adaptation logic to make it uniform. clk,reset,address,read,readdata,waitrequest are probably all you need on the slave. On the master, you would want a bursting master. --- Quote Start --- On the avalon slave, does the nios instruction master ever write data or does it only read it? --- Quote End --- Yes, you can make a read-only interface for an instruction cache. --- Quote Start --- As from my view instruction memory should be readonly but on the other hand the instructions somehow need to get into there (via the datamaster???). --- Quote End --- Yes either through the data master of the NIOS, or maybe some other means depending on your system. For you cache, it's "dont care". --- Quote Start --- I figured the data width of that interface should be 32 bits as the nios instructions are also 32 bits? The address width should be the same as sdram size in bytes / 32 bits data width. --- Quote End --- If your SDRAM is also 32-bits, you can simplify your life and just think of it like your cache has to have the same number of address bits as the SDRAM Altera-MM Slave port does. Yes, your slave should be 32-bits just like the NIOS. --- Quote Start --- So my assumption is when the instruction master wants to read an instruction it would set the address and assert the read signal on my avalon slave. The address is already [cleaned from baseaddress, in the range of the sdram size, at this point ??? --- Quote End --- Check out the "bridgesToMaster" interface property in mnl_avalon_spec.pdf Yes, when your slave receives a read at address 0, you want your master to issue a read at address 0. --- Quote Start --- The avalon slave than needs to check the internal memory(cache) if valid data is there and would return it, if not it needs to read a cache block, multiple bytes, from the sdram controller, strore that internally and return the correct output. On a cache hit, I have a fixed amount of clock cycles it will take me to return the data, on a miss this will be variable depending on how long it takes the sdram controller to read and return the data. So what I would do is as soon as I see the read signal asserted, I would assert the waitrequest signal because at that point I can not know how long it will take to return valid data. As soon as I have the valid data, I would than deassert waitrequest and will "wait" until the instruction master has deasserted my slaves read signal, indicating to me that on the next clock cycle a new read could occur. Can somebody please verify if my assumptions are correct so far? --- Quote End --- It all sounds roughly correct and of course there are a lot of little details you need to get correct. I'm not sure what you envision as your test and development environment, but I can recommend getting started with the Avalon BFM's in simulation sooner rather than later, but you might find using the System Console to issue reads and SignalTap to debug might be easier if you're just learning things.