Forum Discussion
Well, actually maybe I got it...let me first explain better how the system's configured: I have a previously made NiosII System (made for a DE1 Board, with SDRAM, RS232, LEDs etc.) which performed RSA in software (of course very poorly). I have now designed a Verilog Hardware RSA Coprocessor to perform the operations, which I want to insert INSIDE of the SoPC System, by means of the avalon bus interface. I had a top level entity designed in Verilog which I have adapted so now it is included in a wrapper moduel which comprehends the coprocessor itself, two Avalon Masters (one for reading from the SDRAM and one to write the results in it) and une Avalon Slave, which exposes two registers (one address input register and one input/output control/status register). Now the connections all seemed to work, and I have managed to successfully generate my SoPC Builder System: I just have to know how to expose it to my C NiosII Software Build Tools project. SoPC Builder of course generated the system.h file which contains an alias for the Base address of my coprocessor, which I can use inside of my file for accessing the first register. Now, what should I add to the _regs.h file? Is there some mandatory thing that I haven't considered, or the rest of the "dirty work" is done automatically by the Master and Slave template interfaces that I have inserted?
Question# 2, to access the slave register number 1 (which is the second one, since the first is number 0) should I put some kind of displacement inside of the regs.h file? and which one: 32 or 1, (i.e: cause the accesses are always considered as word aligned)? Is there any mechanism to add automatically the displacement to the base address? Thanks a lot