Forum Discussion
Altera_Forum
Honored Contributor
16 years ago --- Quote Start --- To be able to read two different 32-bit registers, you need to do some address decoding in your verilog code. For example you could assign read_data to qx if the address is 0 and to qy if the address is 1. Then from your software you can access them with IORD(SCALAR_POINT_INST_BASE,0) and IORD(SCALAR_POINT_INST_BASE,1). --- Quote End --- hey i guess i am back with another doubt .. i am able to now write to the component but i am just using the same offset i.e. 0 and i have used flags in verilog to identify the data and store appropriately. my problem is when it comes to read i tried using a count variable to provide delay so that the nios could read and print the values.. well it does that but the output is random what i mean is that at times its right and at times its wrong . I dont know why could any one tell me why ?? 2nnd doubt: when i tried using different offsets for data as mentioned in the quote it works fine for offset 0 only and not any other. i defined address decoding using offsets in verilog but it didnt work. my basic doubt is do i have to write my own 'regs.h' file for my SOPC component if not could please some one help me out .. i guess the whole offset idea is not cear so could some one clarify this please.. thanks alot if any