Porting AVR8


Guest thefloe

Recommended Posts

Guest thefloe

I was really pleased to read about the Papilio One and your Arduino like AVR8 core. At the moment I only have access to a Altera FPGA Board and so I tried to port the project to my Cyclone2. First tests were successful but when I tried the first GCC compiled project the code failed.

The problem is the jump instruction at the beginning of the file: 0x940C 0x0030. After that the PC is set to 0x940C and after that to zero again. I checked the XPM files and read the hardcoded men info. There the jump was instruction was reversed: 0x007E 0x940C. So I tried a little around changing the bytes in the words and the words order but had no success.

Can anyone help me out on this?

post-0-13431627479562.png

Link to comment
Share on other sites

Guest thefloe

Hi,

I'm not using that data2mem tool. I wrote my own tool to convert from hex to alter memory initialization file (mif).

The strange thing is that when decoding the jmp instruction (0x940C) is that the PC is set to ox940C after 2 cycles where the core should have read the second part of the 32bit instruction and set it to 0x0030.

I tried functional and timing simulations with alter modelsim but no success. Is anyone else working on the AVR8 for ALTERAs?

Link to comment
Share on other sites

Not that I know of,

But I spent a long time in simulation trying to track down very similiar problems when I first got the AVR8 up and running. The processor turned out to be perfectly fine and it was the supporting tools that caused the problem.

Ruslan has had the AVR8 design running in silicon for many years, so it is safe to assume that the AVR8 design is solid.

It could be something Altera related, but I would look closely at the tools.

Jack.

Link to comment
Share on other sites

Guest thefloe

Figured it out. I created the Altera Memories (using the MegaFunction Wizard) with registered output ports. Because of that every instruction was delayed one clock cycle and therefor the address for the jump was really the jump instruction itself. After unchecking the checkboxes for registered output ports for program memory and data memory the core workes fine.

Thank you!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.