OpenCores
no use no use 1/1 no use no use
Or1ksim with SystemC UART running linux
by NeoBelerophon on Jan 25, 2012
NeoBelerophon
Posts: 10
Joined: Nov 29, 2011
Last seen: Jul 16, 2012
Hi,

I'm using the lastest Virtual Image and applied the SystemC Example with the UART from Embecosm to it.
All examples of the Appnote are working. Also booting linux in or1ksim is working.

Now I changed or1ksim.cfg to use a generic section like it's done in the examples instead of the integrated UART.

Now I start the interrupt SystemC example with the modified or1ksim.cfg and the vmlinux image.
Boot seems to work proper but after "Freeing unused kernel memory: 1416k freed" serial console is broken.

I'm able to enter commands but the response is unreadable as you can see in the attached log.

What can I do?

Output:
Linux version 3.1.0-rc6-00002-g0da8eb1-dirty (openrisc@openrisc-VirtualBox) (gcc version 4.5.1-or32-1.0rc4 (OpenRISC 32-bit toolchain for or32-linux (built 20111017)) ) #14 Wed Nov 16 18:11:19 CET 2011
CPU: OpenRISC-12 (revision 1) @50 MHz
-- dcache disabled
-- icache disabled
-- dmmu: 64 entries, 1 way(s)
-- immu: 64 entries, 1 way(s)
-- additional features:
-- PIC
-- timer
setup_memory: Memory: 0x0-0x2000000
Reserved - 0x01ffda90-0x00002570
Setting up paging and PTEs.
map_ram: Memory: 0x0-0x2000000
On node 0 totalpages: 4096
free_area_init_node: node 0, pgdat c0246200, node_mem_map c03c0000
Normal zone: 16 pages used for memmap
Normal zone: 0 pages reserved
Normal zone: 4080 pages, LIFO batch:0
dtlb_miss_handler c0002000
itlb_miss_handler c0002108
OpenRISC Linux -- http://openrisc.net
pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
pcpu-alloc: [0] 0
Built 1 zonelists in Zone order, mobility grouping off. Total pages: 4080
Kernel command line: console=uart,mmio,0x90000000,115200
Early serial console at MMIO 0x90000000 (options '115200')
bootconsole [uart0] enabled
PID hash table entries: 128 (order: -4, 512 bytes)
Dentry cache hash table entries: 4096 (order: 1, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 0, 8192 bytes)
Memory: 28696k/32768k available (2031k kernel code, 4072k reserved, 300k data, 1416k init, 0k highmem)
mem_init_done ...........................................
NR_IRQS:32
100.00 BogoMIPS (lpj=500000)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 1024
devtmpfs: initialized
NET: Registered protocol family 16
Switching to clocksource openrisc_timer
Switched to NOHz mode on CPU #0
NET: Registered protocol family 2
IP route cache hash table entries: 2048 (order: 0, 8192 bytes)
TCP established hash table entries: 1024 (order: 0, 8192 bytes)
TCP bind hash table entries: 1024 (order: -1, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
TCP reno registered
UDP hash table entries: 512 (order: 0, 8192 bytes)
UDP-Lite hash table entries: 512 (order: 0, 8192 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
Unpacking initramfs
Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
90000000.serial: ttyS0 at MMIO 0x90000000 (irq = 2) is a 16550A
console [ttyS0] enabled, bootconsole disabled
console [ttyS0] enabled, bootconsole disabled
ethoc-mdio: probed
NET: Registered protocol family 17
Freeing unused kernel memory: 1416k freed
Bg0
p

tt

ls
m[[cobsm4

RE: Or1ksim with SystemC UART running linux
by jeremybennett on Jan 25, 2012
jeremybennett
Posts: 815
Joined: May 29, 2008
Last seen: Jun 13, 2019

Hi NeoBelerophon

This is a little baffling - is the console output you show appearing on the xterm from the SystemC UART, or is it appearing in the terminal where you ran your Linux kerne?

The Embecosm application note has note kept pace with Or1ksim - some of the APIs have changed, although I would expect that to show by your application not compiling. Could you be explicit about how you compiled the application incorporating the SystemC compiler and how you then invoked it to run Linux.

Jeremy

--
Tel: +44 (1590) 610184
Cell: +44 (7970) 676050
SkypeID: jeremybennett
Email: jeremy.bennett@embecosm.com
Web: www.embecosm.com

RE: Or1ksim with SystemC UART running linux
by jeremybennett on Jan 25, 2012
jeremybennett
Posts: 815
Joined: May 29, 2008
Last seen: Jun 13, 2019

That should of course read "... The application note has not kept pace..."

Jeremy

RE: Or1ksim with SystemC UART running linux
by NeoBelerophon on Jan 25, 2012
NeoBelerophon
Posts: 10
Joined: Nov 29, 2011
Last seen: Jul 16, 2012
Hi Jeremy

this was the output of the xterm window and the try to execute the ls command.

There where some minor changes necessary to compile the app note with the current or1ksim but
this only concerning const parameters etc. I sent the changes to you some weeks ago.

For compilation I use GCC 4.6.1, SystemC 2.2.0, TLM 2.0.1

I run the example with:
./sysc-models/intr-soc/intr-soc ./or1ksim.cfg ../../../../soc-design/linux/vmlinux


or1ksim.cfg is the one from the ./soc-design/linux/arch/openrisc/ directory which works with the vmlinux.
The only change is that the UART is commented out and generic section from simple.cfg is added.

The strange thing in my opinion is that output works fine till busybox starts.

RE: Or1ksim with SystemC UART running linux
by jeremybennett on Jan 26, 2012
jeremybennett
Posts: 815
Joined: May 29, 2008
Last seen: Jun 13, 2019

Looks like the xterm is not the problem. It was working all the way through boot. Something funny with BusyBox, but strange if it normally works.

When I wrote the paper, it worked find with BusyBox, but there might be something new that is a problem. The thing is the device driver is in the kernel not BusyBox, so why didn't any problems show earlier.

Might be worth seeing if there are any suggestions on IRC (channel #opencores on freenode.net).

Jeremy

RE: Or1ksim with SystemC UART running linux
by NeoBelerophon on Jan 27, 2012
NeoBelerophon
Posts: 10
Joined: Nov 29, 2011
Last seen: Jul 16, 2012
Hi,

to exclude timing problems I remove all debug output of the SystemC models and
recognised that there are sometimes appear this message:

TermSC: Error on write

could this cause such behaviour?
RE: Or1ksim with SystemC UART running linux
by jeremybennett on Jan 27, 2012
jeremybennett
Posts: 815
Joined: May 29, 2008
Last seen: Jun 13, 2019

Hi NeoBelerophon

That certainly looks suspicious! Worth digging into the source code, to find out more about when that happens and why.

Look forward to hearing what you find out.

Jeremy

RE: Or1ksim with SystemC UART running linux
by NeoBelerophon on Jan 30, 2012
NeoBelerophon
Posts: 10
Joined: Nov 29, 2011
Last seen: Jul 16, 2012
Progress so far:

I added a cout to TermSC::xtermWrite and UartSC::busWrite( unsigned char uaddr, unsigned char wdata ) to see if all charakters are send right from core and what xterm receives.

Log:

SSeerriiaall:: 88225500//1166555500 ddrriivveerr,, 44 ppoorrttss,, IIRRQQ sshhaarriinngg ddiissaabblleedd

9900000000000000..sseerriiaall:: ttttyySS00 aatt MMMMIIOO 00xx9900000000000000 ((iirrqq == 22)) iiss aa 1166555500AA

��ccoonnssoollee [[ttttyySS00]] eennaabblleedd,, bboooottccoonnssoollee ddiissaabblleedd

ccoonnssoollee [[ttttyySS00]] eennaabblleedd,, bboooottccoonnssoollee ddiissaabblleedd

 ��
FFrreeeeiinngg uunnuusseedd kkeerrnneell mmeemmoorryy:: 11440000kk ffrreeeedd

init started: BBusyBox v1.19.0.ggit (2011-02-16 008:10:12 CET)

Configuring looppback device



Please press Entter to activate tthis console. ifconfig: sockett: Function not iimplemented

ip: socket: Funcction not implemeented

ip: socket: Funcction not implemeented

# llss

bin dev etcm init[[0m mnt[[0m procc rooot sbbin ssys musr var


Beside the controlsigns shown by gnome-terminal this looks ok until Freeing the unused memory.
Now only every 16th charakter is passed to xterm all others are skiped !?!?
The output of ls is colored in gnome-terminal so I think the every 16th character scheme is disturbed be the not visible coloring informations.

I'm not sure how this could happen despite the use of buffers. Any sugestions?


no use no use 1/1 no use no use
© copyright 1999-2026 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.