Forum Discussion
Altera_Forum
Honored Contributor
13 years ago --- Quote Start --- the only thing I need is to be able to read the time of calculating the coefficients --- Quote End --- You're providing the coefficients. I assume you mean the calculation time, where the calculation uses the coefficients. However, this time will be static - it'll be however many clocks you design the hardware to take. --- Quote Start --- By GF3 I only mean that the coefficients need 3 values(so 00 01 10) hence for a polynomial of degree of 1000 I need 2000 bits to represent it. --- Quote End --- So using 32-bit wide RAM, you can transfer 16 2-bit values to ram on every write, so your 2000-bits require 2000/32 = 62.5 x 32-bit locations. --- Quote Start --- Is there any sort of tutorial on how to use the dual-ported RAM? --- Quote End --- There's a MegaFunction users guide. Just create an instance in Modelsim and simulate it. The RAM operates synchronously; a write occurs when you assert the address data and write-enable signal, a read is a little trickier in that data is output after a pipeline delay. Simulating the RAM will make this clearer. --- Quote Start --- Also how will my logic know that the data is ready to take? And how will the nios ii know that the calculating is over? --- Quote End --- In addition to the RAM, you'll want a control FSM. The inputs/outputs to the FSM will be at least 'enable' and 'done'. Once you've got that working, you might decide that the number of coefficients is variable, so add a register for how many bits are in the RAM, etc. Start off with 'enable' and 'done'. The 'done' signal could be implemented to generate an interrupt to the NIOS II processor. Once you get the coefficient RAM and control FSM working, you can wrap it into a Avalon-MM slave component; one slave for the RAM logic, and another for the control bits. The control bits could just use a PIO component, but once you've figured out how to get one Avalon-MM slave component working, you'll find its easier just to create your own slave blocks. Cheers, Dave