I used DSP Adv block to build a module which includes tens of scalar variables. I used to different dualmem blocks to store and modify them. Is there another efficient way to store?
Thanks Jiuxiang链接已复制
--- Quote Start --- They are not constant and may be written and/or read on any clock cycle. --- Quote End --- if you don't want to use ram then use registers. I don't know if dspbuilder provides enable on registers(delay units), if not so use a mux to enable the path i.e. pass feedback data & new data to a dual inputs mux and select between them according to your write signal, the output of mux goes to a delay unit and fedback to input of mux to keep it if your write is not active.
Thank your reply. I used ModelPrim in DSP Advanced Builder. There is not register unit as I know. Now I used dualmem (ram) to save these variables and access them as you said. But it is hard to compute the delay and to set multiple mux to satisfy different access. So I want to find a more efficient way to restore the variables.
--- Quote Start --- Thank your reply. I used ModelPrim in DSP Advanced Builder. There is not register unit as I know. Now I used dualmem (ram) to save these variables and access them as you said. But it is hard to compute the delay and to set multiple mux to satisfy different access. So I want to find a more efficient way to restore the variables. --- Quote End --- There is sample delay unit (in effect a register) but it has no enable port so I suggested using a mux to apply enable. It should work and data would be written within one clock (set sample delay to 1). It can be read anytime.
Thank your suggestion. Unfortunately, there is not register unit in Advanced DSP builder. I tried to replace it with FIFO. This works but there are 3 delay from read. Anyway this is a smart solution instead of Dualmem which is ram and slower than FIFO.
--- Quote Start --- Thank your suggestion. Unfortunately, there is not register unit in Advanced DSP builder. I tried to replace it with FIFO. This works but there are 3 delay from read. Anyway this is a smart solution instead of Dualmem which is ram and slower than FIFO. --- Quote End --- There is certainly a register block. I use it regularly and is called sample delay(find it some where under one of libraries of ADSPBuilder. It infers a register or ram depending on delay. setting it to 1 infers a register.
--- Quote Start --- A register may be a Z^-1 block. --- Quote End --- yes it is sample delay block(in ModelPrim library) and if set to 1 then infers a register and carries symbol of z^1. BTW xilinx SysGen(equivalent to Altera ADSPBuilder) has delay block as above but also has separate register block. Their register block has ports for reset and enable. Altera's sample block is naked of ports apart from D&Q
