Linux Hexagon architecture development
 help / color / mirror / Atom feed
From: cotulla@yandex.ua
To: linux-hexagon@vger.kernel.org
Subject: Re: [DISCUSSION] Hexagon code inside kernel
Date: Sun, 24 Feb 2013 16:00:35 +0400	[thread overview]
Message-ID: <171311361707235@web14d.yandex.ru> (raw)
In-Reply-To: <1361593470.29465.17@driftwood>

> šThe clever thing hexagon did was avoid any pipeline interlocks. Instead
> šthey had as many register profiles as pipeline stages, and they
> šround-robined them down the pipeline. So the v2 processor ran at 600
> šmhz but presented to Linux as a 6-way SMP chip each running at 100 mhz.
>
> šThis meant there were 6 clock cycles between each memory access, so the
> šDRAM had no trouble keeping up. There was no speculative execution, no
> šbranch prediction, it never did wasted work and any pipeline stage that
> šhad nothing to do powered down completely for that clock cycle. They
> šgot performance out of it via massive parallelism: each instruction was
> ša 4-issue VLIW, and the latter two cores were 4-way SIMD vector
> šthingies, so if you could break your task into 6 chunks (4 graphics
> šprocesses, an audio process, and a control process) it could do some
> šquite heavy lifting.
>
Good to know.
During tests I got around 90 Mbytes/sec RAM access in simple memcpy on 256Mhz, while ARM got around 880 Mbytes/sec.
Do you think it's normal or maybe something configured wrong?
memcpy is done via simpliest way:
Memory is L1WB L2C. I & D prefetchings are enabled.

memcpy:
{ 
    loop0 (memcpy+0x10, r2)
    p0 = cmp.eq (r2, #0)
    r3 = r0 
}
if (p0) jumpr r31
r2 = memb (r1 ++ #1)
{ 
    nop
    memb (r3 ++ #1) = r2 
}:endloop0
jumpr r31


> šThe version I saw (v2) had a software loaded TLB which a binary blob
> šmade act like an MMU. It had too few TLB slots and kept thrashing them
> šwhen running a real OS, so they were going to add more in a future
> šversion.
>
Yes, like MIPS. Intersting how many TLBs ARM processors have?


> šSo it's realy cool technology, fairly widely deployed, and if you want
> što make use of it I'd recommend reverse engineering it. (You can look
> šaround the code aurora forum pages and download the toolchains they
> šgive to the android guys; those binary blobs get built with modified
> šgcc+binutils and the lawyers scrupulously obey the letter of the law as
> šthey understand it; the code is published at an obscure URL somewhere.)
>
> šThe fun part is that "objdump" can decode the magic instructions, even
> šin the binary blob. Because it has to be able to compile them, you see.
> š(They're working on Hexagon support for Open64 and LLVM, but gcc's
> šstill a more mature compiler. Google for "hexagon open64" and similar
> šfinds interesting stuff, by the way.)
Yes. 
Actually we got kernel to work up to userland init process!
Ofcourse there are still some not done things like SMP support or not optimized things (like it's flushing always full TLB instead of parts)
But it's already look rather well.

One of the problems - seems CONFIG_PREEMT is not supported with HVM code.
Maybe it's good idea to look at ARM or MIPS implementation and reimplement it from scratch.


> šThat was using... comet boards, I think? (Those hacked up phone
> šmotherboards Linas was talking about. The "snapdragon" SoC, QDSP6v2
> šchips plus a Scorpion plus an armv5 plus a QDSP4, all in a big ball
> šwith USB and a serial port and an ethernet device and 256 megs of
> šmemory and I forget what else. We had a small number of them because
> šthey never made that many. Not a mass produced product, semi-obsolete
> šat the time, but the linux porting effort scrounged what resources it
> šcould...)
Yea. QDS8x50B. My platform (HTC HD2) has exactly same SoC :-)


-Cotulla

  reply	other threads:[~2013-02-24 12:00 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-15 14:28 [DISCUSSION] Hexagon code inside kernel cotulla
     [not found] ` <CAHrUA364XES66kXhr0Gg1dh_MQBAS0+R8Q4x+EY3dgz6s=QRww@mail.gmail.com>
2013-02-15 22:33   ` Linas Vepstas
2013-02-16  1:35     ` cotulla
2013-02-16  2:34       ` Linas Vepstas
2013-02-16 12:39         ` cotulla
2013-02-16 17:33           ` Linas Vepstas
2013-02-16 19:21             ` cotulla
2013-02-19  4:36           ` rkuo
2013-02-19 14:29             ` Linas Vepstas
2013-02-20  1:07               ` cotulla
2013-02-20  1:17             ` cotulla
2013-02-23  4:24           ` Rob Landley
2013-02-24 12:00             ` cotulla [this message]
2013-02-24 16:32               ` Linas Vepstas
2013-02-24 17:29                 ` cotulla
2013-02-24 21:03                   ` Linas Vepstas
2013-02-25 17:26                     ` Rob Landley
2013-02-26 18:54                       ` cotulla
2013-02-27  0:58                         ` Rob Landley
2013-02-27 12:39                           ` cotulla
2013-02-24 12:23             ` cotulla
2013-02-26  6:55               ` Rob Landley
2013-02-26 19:30                 ` cotulla
2013-02-26 19:32                 ` cotulla
2013-02-26 19:59                   ` Linas Vepstas
2013-02-26 20:25                     ` cotulla
2013-02-26 20:57                       ` Linas Vepstas
2013-02-27  1:06                   ` Rob Landley
2013-02-27  1:30                     ` Linas Vepstas
2013-02-27  3:03                       ` Rob Landley
2013-02-27 12:35                         ` cotulla
  -- strict thread matches above, loose matches on Subject: below --
2013-02-24  0:24 Linas Vepstas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=171311361707235@web14d.yandex.ru \
    --to=cotulla@yandex.ua \
    --cc=linux-hexagon@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox