cmd file of Harvard architecture

DSP Topics
SukhdeepMankoo
Lieutenant
Lieutenant
Posts: 92
Joined: Tue Oct 27, 2009 7:50 pm

cmd file of Harvard architecture

Post by SukhdeepMankoo » Sat Jul 03, 2010 2:41 pm

Hi,
As we know that harvard architecture has different address lines for data and code. It means that harvard architecture has same address for address for code and data. for example address 0 for RAM has data, while address 0 for flash has code.
TMS320C6713 is based on Harvard architecture. Then how can i write *.cmd file for harvard architecture?

example:

Memory
{ CACHE: origin=0x00000000, len=0x00030000
FLASH: origin=?
}
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

Re: cmd file of Harvard architecture

Post by Neo » Sun Jul 04, 2010 2:40 am

I think your processing architecture is VelociTI very-long-instruction-word (VLIW) ?

In C6000, you can use each memory section as 'only code', 'only data' or 'both code and data' in these DSPs as you prefer.
As a practice, I used to separate out code and data in to two sections (for safety) though it is not necessary.

Since you are trying to specify something on Flash, I doubt that you misunderstood burning firmware to Flash under DSPs.
If you have enough Internal RAM and External RAM, you can allocate all your code and data to RAM. Then generate the .out file. After that you will write this file using the provided Flashing utility to your Flash. Then you set your boot device as Flash.
At boot time, the bootloader will load the code in Flash to RAM as specified by you and pass the control to RAM (Entry Point).

However, if you are going to run everything from Flash (which not quite usual in C6000 chips as we have enough IRAM and External RAM), then you need to specify the sections to Flash.

A good exercise would be, write a program which is 100% in RAM, Burn it to Flash, Boot from Flash and see how it goes.
SukhdeepMankoo
Lieutenant
Lieutenant
Posts: 92
Joined: Tue Oct 27, 2009 7:50 pm

Re: cmd file of Harvard architecture

Post by SukhdeepMankoo » Thu Jul 08, 2010 10:15 am

Thanks Neo,
You are right. but suppose if my code is bigger than the internal RAM of DSP. then i have to place the code in flash too. how should i write code for that as DSP is based on Harvard Architecture.

Second thing, if i have burned the code into flash, will this code include the bootloader program for DSP to fetch code from Flash or will it do automatically?

Thanks & Regards
Sukhdeep Singh
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

Re: cmd file of Harvard architecture

Post by Neo » Thu Jul 08, 2010 9:21 pm

If you like you can reserve flash pages for data and code. But I do not see any problem in keeping both code and data in a single page in this architecture. You just need to define the memory addresses to avoid overlapping code and data.

Magneto has done lots of flash based firmwares on C2000 platform. When I had a brief discussion with him, he told me, he stored both code and data on the same flash page on his work without any problem. He will add his comments later hopefully.
SukhdeepMankoo
Lieutenant
Lieutenant
Posts: 92
Joined: Tue Oct 27, 2009 7:50 pm

Re: cmd file of Harvard architecture

Post by SukhdeepMankoo » Fri Jul 09, 2010 10:07 am

Thanks,
Will DSP automatically pickup the code written into the flash or i need to write code,so that it will start fetching code from flash?
User avatar
Magneto
Major
Major
Posts: 430
Joined: Wed Jul 15, 2009 1:52 pm
Location: London

Re: cmd file of Harvard architecture

Post by Magneto » Fri Jul 09, 2010 11:37 am

Dear Friend ,

It seems your DSP have not any internal Flash , so if you want to use Flash memory , you have to connect an external Flash Chip to External Interface of DSP. If you see the memory map of your DSP , it seems there is unique ID range ( 0x0180 0000 to 0x 0183 FFFF ) . So every memory location in your DSP can address with a unique ID whether they are RAM or Flash with in single bus.

Normally there is a boot rom in every TI DSP , so I think your DSP also have that. When you first power up the DSP , it will jump to this Boot ROM and then according to few GPIO settings it will jump to the first address of RAM or External Interface ( in your case FLASH). You have to find this GPIO HIGH LOW settings , which want to jump your DSP to External interface ( Flash). It should contain in the data sheet.

So then you have to keep the first instruction of your program , at the beginning address of external interface ( i.e. 0x0180 0000 ). Then after power up , it will execute instructions from the beginning of the flash

Regards,
Magneto
SukhdeepMankoo
Lieutenant
Lieutenant
Posts: 92
Joined: Tue Oct 27, 2009 7:50 pm

Re: cmd file of Harvard architecture

Post by SukhdeepMankoo » Fri Jul 09, 2010 12:29 pm

Thanks Magneto and Neo,
I am using TMS320C6713B DSP processor and it has

1) EMIF CE0 0x80000000
2) EMIF CE0 0x90000000
3) EMIF CE0 0xA0000000
4) EMIF CE0 0xB0000000

where suppose external flash is connected to EMIF CE1.

c code
#include.......

int main()
{
.........
}

Now Cmd file
MEMORY
{ FLASH: origin=0x90000000 len=0x00080000
RAM: origin=0x00000000 len=0x00030000
}
SECTIONS
{ .text > FLASH
.cinit > RAM
}

Am i right? if wrong, please correct me.
Regards
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

Re: cmd file of Harvard architecture

Post by Neo » Fri Jul 09, 2010 4:00 pm

Seems correct. Are you using the DSK from Spectrum Digital?
SukhdeepMankoo
Lieutenant
Lieutenant
Posts: 92
Joined: Tue Oct 27, 2009 7:50 pm

Re: cmd file of Harvard architecture

Post by SukhdeepMankoo » Fri Jul 09, 2010 5:08 pm

Thanks.
Yes, i am using DSK for TMS320C6713.
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

Re: cmd file of Harvard architecture

Post by Neo » Fri Jul 09, 2010 5:16 pm

Is it having a 16 MB RAM connected on CE0 ? If that is the case, are you going to remove it from your final design?
Post Reply

Return to “Digital Signal Processors”