I have done something similar with an Altera DE1 board (Cyclone II) 
and the 8052 core from opencores.org.  Fortunately this softcore 
comes with all the standard 8052 peripherals, including the serial 
port.  I had to modify the VHDL code in order to use the altsyncram 
megafunction for RAM, XRAM, and ROM.  Then it was very easy to select 
which hex file to use:

altsyncram_component : altsyncram
GENERIC MAP (
.
.
         init_file => "myfile.hex",
         intended_device_family => "Cyclone II",
.
.
.

To change the hex file executed by the softcore there are two options 
with Quartus II: recompile the whole project (10 minutes or so!) or 
use the 'In-System Memory Content Editor' which is considerably 
quicker.  There was a really bad bug with some versions of Quartus II 
(version 7 if I remember correctly) that badly corrupted the memory 
after loading a hex file with the 'In-System Memory Content Editor', 
but Altera fixed that in more recent versions.

FYI, the softcore used about 34% of the logic elements and 30% of the 
memory bits available in the Cyclone II (EP2C20F484C7) that comes 
with the DE1 board.


At 01:10 AM 30/07/2009, you wrote:


>Hello,
>
>I am using SDCC (small device c compiler)on Linux to compile a C 
>code for the 8051 core to execute.. The VHDL source code I use for 
>the Core is available free from Oregano Systems.
>
>On Linux I do,
>sddc test.c(compiling the code , this gives me .ihx file)
>and then
>packihx test.ihx > test.hex (This gives me a hex file).
>
>Can anyone help me to know what is the next step?
>Where do I keep this .hex file for the CPU to execute the binary.?
>
>The CORE I downloaded has 3 memories in it(RAM,RAMX,ROM)
>Has anybody tried it in his/her project?
>
>
>I tried to copy the .hex file into the rom.dua(ROM) file for Oregano 
>design but it does not seem to work.
>
>Since , I use pure VHDL design, there is no serial port /parallel 
>port concept(I use no kit)
>
>For your reference , I am attaching test.c, test.hex files along 
>with the mail.
>In short, my question is -
>
>Where do I keep my compiled hex file for the CPU to execute it(the binary)?
>
>Regards,
>Prateek


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to