Forum Discussion
Altera_Forum
Honored Contributor
14 years agoDear K_J,
--- Quote Start --- First you'll need to decide whether the input and output interfaces of CDMA Encoding and Decoding should be 'pulled' or 'pushed' through the pipeline. This will determine if that interface is a 'master' or 'slave' interface in Avalon jargon. An example of 'pushing' would be the encoding block simply outputs data when it has it available to send and it is expecting the receiver to catch it. In your example, you simply listed what looks to be the data path signals 'PI' and 'Output', but there are no signals to indicate when data is actually valid. An example of 'pulling' would be if the decoding block decided when it was ready to receive data from the upstream block which was then expected to supply the data. To get a bit more concrete, you will have to look at each interfaces and decide based on your design which implementation is easiest to accomplish. The only hard and fast rule is that a 'master' talks only to a 'slave'; 'master' do not talk to each other, nor do 'slaves'. Every transfer is initiated by the 'master' and acted on by the 'slave'. Here is your data flow NIOS-->CDMA_ENCODING-->AVALON-->CDMA_DECODING-->SLAVE And here I've pencilled in a possible implementation where (M) indicates the interface is a 'master', (S) indicates a 'slave'. Note that encoding and decoding blocks each have an input and an output interface. NIOS-->(S)CDMA_ENCODING(M)-->(S)CDMA_DECODING(M)-->(S)SLAVE or perhaps this, assuming that the output to what you called 'SLAVE' is not Avalon NIOS-->(S)CDMA_ENCODING(M)-->(S)CDMA_DECODING-->SLAVE Thanks in advance K_J. Your other choice could be for the Avalon interface between the CDMA blocks could also be: NIOS-->(S)CDMA_ENCODING(S)-->(M)CDMA_DECODING-->SLAVE Again, whether you choose the connections between the two CDMA blocks is somewhat arbitrary, do what is convenient for you. The Avalon fabric will stitch together the 'master' to 'slave' logic, but you need to provide the 'master' and the 'slave'. Once you have the flow control defined, then you look at the Avalon manual. Assuming you chose the following flow NIOS-->(S)CDMA_ENCODING(M)-->(S)CDMA_DECODING-->SLAVE Then then CDMA_ENCODING block is a master and is pushing data out to a slave. This means the following: - CDMA_ENCODING needs to provide a 'write' and 'writedata' signals as outputs, and 'waitrequest' as an input. - CDMA_DECODING needs to provide 'chipselect', 'write' and 'writedata' signals as inputs and (optionally) provide 'waitrequest' as an output. If you refer to the Avalon manual it actually is pretty clear about what the signals definitions are, but you need to know what type of interface is needed and understand that each of the connections you show in your flow diagram represent interfaces. It's actually not that hard once you get the first one or two under your belt and Avalon does provide a simple low overhead flow control mechanism that is almost always needed since there are very few cases where something can simply blast out data and expect something to be able to receive and process it on every clock cycle from here to eternity. Even if you were simply writing something to memory, a memory controller would always have to pause on occasion to generate a refresh to the memory device...which implies that something that is shoving data at it would have to pause as well which implies there has to be some signalling for data flow control. Kevin Jennings --- Quote End --- --- Quote Start --- NIOS-->(S)CDMA_ENCODING(S)-->(M)CDMA_DECODING-->slave --- Quote End --- if my case is above then what is the (M)CDMA_DECODING(?).. will it be slave port ? if its is a slave port is it possible to connect slave. can i choose is both sides as master ports , so that i can connect to slave