OpenCores
no use no use 1/1 no use no use
Read uart on Plasma Cpu for spartan-3e
by trelass on Jul 17, 2010
trelass
Posts: 4
Joined: Oct 12, 2009
Last seen: Oct 30, 2010
Hi all,

I've implemented the Plasma CPU on my spartan-3e starter kit , but i haven't managed to read from the terminal. I can write to it using the putchar() function (from the no_os.c file) but I can't read using the getch() function (it is stuck in the while loop). I tried to read the IRQ_UART_READ_AVAILABLE from IRQ_STATUS and put it to a led but it never became "1" no matter what I press in the terminal ( HyperTerminal in Windows XP). Then I tried to force the IRQ_UART_READ_AVAILABLE to "1" but it doesn't seem to work too. I've written in c language. Any idea of how to make it work?

Thank you in advance
RE: Read uart on Plasma Cpu for spartan-3e
by orinaudo on Jul 17, 2010
orinaudo
Posts: 4
Joined: Feb 17, 2010
Last seen: Jul 17, 2010
can you show output from the linker ?
something like that :
Entry=0x0 length=...

is cache enabled ?
what is the size of your binary file ?

are provided samples running (pi, opcodes...) ?

are you using bootloader and then downloading to ddr (ie entry in 0x10000000) or
using internal ram (ie entry in 0x0)?

irq vector table is located at 0x3c, if your binary as entry in 0x10000000 instead of
0x0 (because of using ddr) then you may try to call at very early start
OS_AsmInterruptInit(); which redirect interrupts from 0x3c to 0x1000003c
this function is located in boot.asm file

Regards
OR
RE: Read uart on Plasma Cpu for spartan-3e
by trelass on Jul 17, 2010
trelass
Posts: 4
Joined: Oct 12, 2009
Last seen: Oct 30, 2010
First of all thanks for your fast reply and your help.

can you show output from the linker ?
something like that :
Entry=0x0 length=...


If you mean HyperTerminal, yes i can write chars using the uart.

is cache enabled ?


I think so...But how can I verify so?

what is the size of your binary file ?


It is not a file but a simple char.

are provided samples running (pi, opcodes...) ?


Yes. My project work fine too (without managing to read the uart of course).

are you using bootloader and then downloading to ddr (ie entry in 0x10000000) or
using internal ram (ie entry in 0x0)?


I am using internal ram. I use Xilinx ISE 11 and ISE iMPACT through USB to program the board.

irq vector table is located at 0x3c, if your binary as entry in 0x10000000 instead of
0x0 (because of using ddr) then you may try to call at very early start
OS_AsmInterruptInit(); which redirect interrupts from 0x3c to 0x1000003c
this function is located in boot.asm file


I think I can read the irq vector because I see IRQ_UART_WRITE_AVAILABLE become "1" when i write to uart and I can see IRQ_COUNTER18_NOT and IRQ_COUNTER18 flashing too.
RE: Read uart on Plasma Cpu for spartan-3e
by orinaudo on Jul 17, 2010
orinaudo
Posts: 4
Joined: Feb 17, 2010
Last seen: Jul 17, 2010
If you mean HyperTerminal, yes i can write chars using the uart.

1)no i mean, the linker output after having (cross)compiled your c code.
before you generate the ram_image.vhd file
you may have the following output on your pc :
Entry=xxx length=yyy
could you provide these values xxx and yyy

is cache enabled ?I think so...But how can I verify so?

2)in ISE, during synthetizing, the console show a lot of informations
by parsing them you'll see retained generics values, such as for plasma :
alu_type =
ethernet =
log_file =
memory_type =
mult_type =
pipeline_stages =
shifter_type =
use_cache =
could you provide these values ?

what is the size of your binary file ?It is not a file but a simple char.

3)length already asked in 1)

are provided samples running (pi, opcodes...) ?Yes. My project work fine too (without managing to read the uart of course).

4)fine

are you using bootloader and then downloading to ddr (ie entry in 0x10000000) or
using internal ram (ie entry in 0x0)?I am using internal ram. I use Xilinx ISE 11 and ISE iMPACT through USB to program the board.

5)ok, so it's not an issue with vector table
RE: Read uart on Plasma Cpu for spartan-3e
by trelass on Jul 17, 2010
trelass
Posts: 4
Joined: Oct 12, 2009
Last seen: Oct 30, 2010
If you mean HyperTerminal, yes i can write chars using the uart.

1)no i mean, the linker output after having (cross)compiled your c code.
before you generate the ram_image.vhd file
you may have the following output on your pc :
Entry=xxx length=yyy
could you provide these values xxx and yyy


Entry=0x0 length=1956=0x7a4

is cache enabled ?I think so...But how can I verify so?

2)in ISE, during synthetizing, the console show a lot of informations
by parsing them you'll see retained generics values, such as for plasma :
alu_type =
ethernet =
log_file =
memory_type =
mult_type =
pipeline_stages =
shifter_type =
use_cache =
could you provide these values ?
Analyzing hierarchy for entity in library (architecture ) with generics. ethernet = '1' log_file = "UNUSED" memory_type = "XILINX_16X" use_cache = '1' Analyzing hierarchy for entity in library (architecture ) with generics. alu_type = "DEFAULT" memory_type = "XILINX_16X" mult_type = "DEFAULT" pipeline_stages = 2 shifter_type = "DEFAULT"
RE: Read uart on Plasma Cpu for spartan-3e
by orinaudo on Jul 17, 2010
orinaudo
Posts: 4
Joined: Feb 17, 2010
Last seen: Jul 17, 2010

Entry=0x0 length=1956=0x7a4
use_cache = '1'


internal ram have 8192 but 4096 are used for ddr cache
minus allocated mem, i experimented some random issues
beyond 3500 bytes length with cache enabled.

but in your case it's small enough not to be the issue

verify if proper
RS232_DTE_TXD , RS232_DTE_RXD
or
RS232_DCE_TXD , RS232_DCE_RXD
are used in the instance u1_plasma port map
depending on the board port you use
eventually try the other port
and finally double check your cable

with actual informations in hand,
i don't know what is happening.

Regards
OR
RE: Read uart on Plasma Cpu for spartan-3e
by rhoads on Jul 19, 2010
rhoads
Posts: 15
Joined: Sep 25, 2001
Last seen: Feb 8, 2012
For HyperTerminal, what do you have the flow control set to? It needs to be set to none. If the flow control is set to hardware, no characters will be sent since the flow control pins aren't connected.

You also might want to look at the free program TeraTerm by doing a Google search.

Steve
RE: Read uart on Plasma Cpu for spartan-3e
by themole on Jul 19, 2010
themole
Posts: 1
Joined: Jul 17, 2006
Last seen: Jul 3, 2011
Hi,

Putty offers also serial terminal functionality, is platform independent and works much better than e.g. HyperTerminal. Many people use it as a ssh or telnet client and have it already installed.

http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

Daniel
RE: Read uart on Plasma Cpu for spartan-3e
by trelass on Jul 20, 2010
trelass
Posts: 4
Joined: Oct 12, 2009
Last seen: Oct 30, 2010
It was terminal's problem finally. I re-install the usb-to-serial drivers and use the terminals you two recommend and it works fine now. I appreciate your help.

Thanks,
Thanos
no use no use 1/1 no use no use
© copyright 1999-2012 OpenCores.org, equivalent to ORSoC AB, all rights reserved. OpenCores®, registered trademark.