Forum Discussion
Altera_Forum
Honored Contributor
20 years agoSome question about buiding custom component
Hey, guys
I am a new NIOS II user and my environment is Quartus 5.0(Win)+SOPC Builder 5.0. The thing I want to do is to build a custom component in VHDL which could be used to communicate with the Avalon bus. First, I have reviewed the PWM given by offical Alera website which is written in Verlig. As I have seen from this example, the design is implemented in three files, including one top level file, one register description file and one custom logic file. So my question is does the registers description file necessary for all compeonent?? In another word, let's say how does SOPC builder know and assign spaces to different register, and also in which order is the space assigned according the VHDL file as i know that the Device Driver in software seems can be neglected in here. another question is I have tried to make my design work regardless with the up question, which seems to be ok to run, but only run by Modelsim. when I use the instruction set simulator to run program and try to read data from the registers, all they become zero. but in Modlesim I can see clearly the correct data has been put on Avalon_readdata signal within the read phase. why can not get in my program?? why why why?? http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/mad.gif http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/mad.gif http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/mad.gif I'm a new user of Alera nios, so plz give me some help any kind of discussion will be welcomed thx a lot3 Replies
- Altera_Forum
Honored Contributor
SOPC builder determines the address spaces by your component's address signals, if your component has 2 bits address signals and it is native slave, Builder will assign 0x0, 0x8, 0xa, 0xc for the components
- Altera_Forum
Honored Contributor
--- Quote Start --- originally posted by aeolus1982@Mar 4 2006, 02:42 PM hey, guysi am a new nios ii user and my environment is quartus 5.0(win)+sopc builder 5.0. the thing i want to do is to build a custom component in vhdl which could be used to communicate with the avalon bus.
first, i have reviewed the pwm given by offical alera website which is written in verlig. as i have seen from this example, the design is implemented in three files, including one top level file, one register description file and one custom logic file.
so my question is does the registers description file necessary for all compeonent?? in another word, let's say how does sopc builder know and assign spaces to different register, and also in which order is the space assigned according the vhdl file as i know that the device driver in software seems can be neglected in here.
another question is i have tried to make my design work regardless with the up question, which seems to be ok to run, but only run by modelsim. when i use the instruction set simulator to run program and try to read data from the registers, all they become zero. but in modlesim i can see clearly the correct data has been put on avalon_readdata signal within the read phase. why can not get in my program?? why why why?? http://forum.niosforum.com/work2/style_emoticons/<#emo_dir#>/mad.gif http://forum.niosforum.com/work2/style_emoticons/<#emo_dir#>/mad.gif http://forum.niosforum.com/work2/style_emoticons/<#emo_dir#>/mad.gif
i'm a new user of alera nios, so plz give me some help
any kind of discussion will be welcomed
thx a lot
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=13120)
--- quote end ---
--- Quote End --- You can partition your component into as many source files as you like. The separation to interface, registers and logic is for convinience only. Note, however, that whenever you change your top file, you will have to assign the Avalon bus port role in the component editor all over again. Avishay.
- Altera_Forum
Honored Contributor
<div class='quotetop'>QUOTE </div>
--- Quote Start --- SOPC builder determines the address spaces by your component's address signals, if your component has 2 bits address signals and it is native slave, Builder will assign 0x0, 0x8, 0xa, 0xc for the components[/b] --- Quote End --- Hi, thx you so much for the answer, but I want to ask in which sequence is the address assigned, is it depend on the vhdl description file's order which make me confuced cause everything seems done automaticlly. <div class='quotetop'>QUOTE </div> --- Quote Start --- You can partition your component into as many source files as you like. The separation to interface, registers and logic is for convinience only. Note, however, that whenever you change your top file, you will have to assign the Avalon bus port role in the component editor all over again. Avishay.[/b] --- Quote End --- thx Avishay for your answer but how do SOPC bulider recognize registers, is there way such as resoure editor to know exactlly how many register in the design and their each address, which can not been seen to me seems. the problem still lies here, why cannot I read data from the registers, I have checked the modelsim simulation, the data in the register has been put on the avalon_readdata signal, but seems the software program cannot get that value. whywhywhy http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/unsure.gif