Welcome, Guest. Please login or register.

Author Topic: Amiga One X 1000 and Xena/Xorro  (Read 34125 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline LyleHaze

  • Newbie
  • *
  • Join Date: Aug 2013
  • Posts: 39
    • Show all replies
    • https://sites.google.com/site/takeaprogrammertolunch/
Re: Amiga One X 1000 and Xena/Xorro
« on: July 07, 2014, 06:50:51 AM »
Greetings everyone. It seems I am late to the party.
I have not made this site part of my usual watchlist, perhaps I'll change that in the future.

I'll start on topic, and may wander from there.

I'd like top start by saying that I am impressed with the accuracy of the discussion so far. Certainly some people are a bit more pessimistic than I am, but at least MOST of the "facts" are true.
One slight correction I'd liketo make:
Quote from: KimmoK;768186
....
http://www.os4depot.net/index.phpfunction=showfile&file=utility/hardware/nemo_led_p31.lha


Nemo_led_p31 allows user control of an "extra" LED header on the Nemo board.
It also allows access by low level code, such as interrupt handlers. As such I have found it very handy when troubleshooting code, but it has nothing to do with the Xena chip. no connection, no relation..
I take no offense to it being described as "Nothing productive", though I would personally disagree with that assessment.

The Xena chip has some very unique capabilities. It also has a few obstacles to be overcome. I will gladly discuss those here as long as I feel the time is well spent. If it becomes more of an argument than a discussion you can expect my continued participation to end. Frankly I have too much to do to spend time arguing with anyone.

Onward.. In addition to coding for OS4 I also have some embedded experience, using small chips that can run code directly without any "OS" to speak of.. I have designed, built, and programmed some unique audio hardware, some stuff used for home automation, and some devices that I used at previous employers to enhance the performance of their equipment. So I have at least _some_ experience with small processors like the XMOS devices.

The XMOS chips like Xena are quite unique.. Unlike most devices it actually has completely separate processing units that run with a fixed speed, completely independent of each other. These threads and cores are linked by a switching fabric that is quite flexible in how things are connected. All of this is an offshoot of an older project called "transputers" that were designed from the ground up to do things differently than classic Von-Neumann architectures.

As with most anything, these chips have certain strengths, and some weaknesses. Each X-Series motherboard has a chip with two cores, each core carrying eight independent threads. (note: The advertising geniuses at XMOS have renamed "cores" as "tiles" and have renamed "threads" as "Cores", so any reference is now muddled by their marketing ingenuity.)  Anyway.. the eight threads on each core share a common block of RAM, but under normal circumstances RAM is NEVER shared between cores. (Yes, there are ways around it, but that would betray the language design).. These threads are designed for processing streams of data, and they do so with exceptional speed.. But without sharing RAM, there has to be a very fast way of moving data around.. So "Links" were implemented. Links come in 2 wire and 5 wire varieties, and they are NOT clocked at a fixed rate.. they can basically accellerate to whatever speed that both the sender and receiver can support.. (within reason) The "fabric" that joins these threads and cores can also be brought out to external links, so that multiple XMOS chips can be joined into larger arrays.. so the end-user can build paralell processing arrays of as many cores/tiles as they choose. In fact the dual core Xena chip appears to the programmer as two separate single core devices..  interesting.
Note: The Xorro board has all the necessary connections to support this.. so the ability to expand this array is available to us.

Now, trying to get back on track.. What these chips do well is serialized data processing, and they can do it with guaranteed maximum response times. This is unique among all the chips and devices that I am familiar with so far. Another neat property is that the "code", the program they run, is loaded dynamically. Nothing is burned to ROM, so the chip, and all the links that configure it, can be stopped, re-programmed with new code, and re-started on demand.. completely "software configurable".
Note" All this programming is done by JTAG, and the other 98% of XMOS users require either a JTAG interface or a USB to JTAG device to play with their chips. The X1000 and Cyrus have these interfaces built right in to the motherboard, so we can safely assume that ALL machines of those two types are "ready to go" with no other stuff required. And yes, the JTAG loop is also brought out on the Xorro card, so additional XMOS chips can be added easily.

I can see that Hans has studied these chips.. the idea of direct control of stepper motors is a good example of what these chips might be very good at. The task is broken down into individual threads, with some consideration for the timing and speed requirements that the task needs. At least the hardware support for CNC control would be a walk in the park for a Xena chip.. the logical needs would still be up to the programmer.

Another project that was mentioned, and one I am much more familiar with, is the idea of adding a SDCard and using Xena to catch and store the debug stream. One thread captures the incoming serial data, one handles writing to the memory card.. but the data comes in one char at a time, and the SD card manager writes in blocks, so a "buffer" thread is placed in between..
Now on a "normal" processor, the problem comes when the chip goes off to write a block of data to the card.. the whole time that takes, the incoming serial is being ignored.. unless you have a chip with a built in hardware buffer, or a separate processor.. but with the XMOS chips you just give each thread it's own part of the larger job, and join them all together with links however you'd like. Also of note is the LARGE community of XMOS enthusiasts, and the public repository of free code.. combining bits of other peoples code is MUCH easier when each bit is running in a separate thread.. so this is really good for hobbyist programmers! A complete SD card read/write package, WITH DOS INCLUDED! serial port code in a few varieties, code for simple audio effects, IR Remote control recording/playback, some serialized data processing stuff.. there is a LOT of code ready to be re-combined into new projects.
I did a short demo of the above serial data logger project, not quite completed in time for the 2012 AmiWest show. If you're really into geeky stuff you can find it on YouTube.

But let me leave the tech stuff aside for a moment to talk about why so little has happened. There have been a few things that have slowed it all down. Mostly my own schedule. Put quite simply, I have been busy working on other stuff. Just before AmiWest 2012 I was able to complete the JTAG programmer that lets us program the Xena chip from the command line. This is not "sexy" stuff, but it's necessary before much else happens.
The initial "flashing LEDs" demo video from the board manufactrurer clearly shows that they plugged in an external JTAG programmer.. that's how everyone else does it. With the JTAG tools (and the supporting code written by Segher) we can do it from the command line.
My next big task was the compiler suite. The "XC" language preferred for these chips is NOT available freely. It is developed and maintained by XMOS, and the code is not public. They have an Eclipse based tool suite that runs on Windows or _SOME_ types of Linux. Sadly enough, only x86 platforms are supported. Recognizing that this would be a hindrance to many Amiga owners, I have tried a variety of ways to get around this. I have asked for support from XMOS, I have discussed this in their forums (which are suprisingly well managed by the company). I have tried a couple emulators under AmigaOS, but I was never able to properly emulate a 32 bit x86 system (16 bit systems will not work).
I tried more advanced emulators, but frankly emulators are not my cup of tea, and my experience on the "other side" is not so strong anyway. I even considered running a bigger emulator under Debian, but jumping back and forth between AmigaOS and Debian for every loop of development would be insane.
I managed to strip the actual command-line tools needed from their "XDE" toolchain, and could write basic makefiles that run well on my netbook. I added FTP scripts on both the netbook and my X1000. I worked out a system where simply typing "make" from the project directory on my Amiga would pack up all project related files, FTP them over to the netbook, which would then compile the project, recording all messages from the compiler and linker, then it zips up the result and sends it all back to the Amiga by FTP, complete with a return code. Slow? Sure. But faster than any other option I could find.
I then set out to make this available to everyone. I tried to set up an EMail account that would process the comile jobs just like my FTP scripts do.. so that Amiga users anywhere could type "make" and actually export the job to an old windows machine standing by for that purpose. I worked on that a long time. I almost got it working. I could gather up the project, LHArc it, email it over, and then process it properly. but I could never quite figure out how to receive mail on an Amiga. I tried Python, I tried a few other things.. but after all that work I simply gave up. My networking skills are not up to the task.

So, end result? Developing for Xena REQUIRES a windows or Linux box. I am sure that there MAY be ways around it, but I am done trying.
Ideally, I know that MANY others in our community are much smarter than I am.. hopefully one will step up to the job. I'll donate an old windows box and the network connection, as long as it won't impede the security of my home network.

Note: Post too long.. continued in next reply.
 

Offline LyleHaze

  • Newbie
  • *
  • Join Date: Aug 2013
  • Posts: 39
    • Show all replies
    • https://sites.google.com/site/takeaprogrammertolunch/
Re: Amiga One X 1000 and Xena/Xorro
« Reply #1 on: July 07, 2014, 06:51:31 AM »
Reply too long, continued here from previous reply.

Onward..
We have the JTAG tools, we have working code for communicating over the "fast localbus" of the X1000, although it's not as fast as I would like. (another story for another time). The same interface on Cyrus has been improved to correct the things I was not happy with, so that's improving as well.
I have code that is 90% complete for a built-in debug logger that requires no extra computer like debug does now.. and the possibility to improve how logging is managed.. Hopefully I'll have time to get back to that project sometime soon. it may be 90% complete but the last 10% is usually the most painful part.
And we, collectively, have a very generous bank of existing XMOS code that can be used as we wish to make all kinds of cool things..

What we don't have are:
A way to compile under AmigaOS, either natively or by network.
Any "finished" projects to show as examples. Yet.
Any people (with one exception) who are willing to get in there and play with these chips.
Another thing we're going to want some day is a real-time manager that allocates threads and links dynamically, so that we can re-task parts of Xena while others remain at task.. VERY cool stuff, but also well outside my abilities.

And why haven't I bothered to finish my Logger? Friends, I have been busy with other coding projects. "Fun" stuff like Xena, and like my own pet project "Score", have gone completely untouched for well over a year now. Only two weeks ago I decided to stop all my other projects and work only on Score... for my own sanity if nothing else. I am happy to announce that Score is now scrolling.. see my video from 2013 AmiWest if you're curious about that.

Finally, if you've been reading along this far.. I'd like to vent about one particularly annoying rant.. Some people keep going on about what A-EON _SHOULD_ be doing with Xena. Xena is there as a USER_DEFINABLE expansion. It's not their unfinished project, it's YOURS.
If you want to do something with Xena. GO FOR IT!
You have the JTAG tools, you have example code, You can develop in their slick Eclipse based dev environment, (Eww, I hate it) or you can run command line tools. Hell, I'll even give you my (really ugly nasty) scripts for FTP automation if you want them. So far ONE person has taken the initiative, and he has discoverd a few things that I didn't know, and fed that information back to me.

I'm sure more projects will be completed. I assume some people will even buy those projects "pre-built", so they get the utility without writing a line of code. But foremost, this is a really unique chip that is quite literally a blank slate. It was put there because the Amiga community used to have a reputation for being innovative.. it's nice that we still have means to do it again, if anyone cares to.

Finally, the opinions expressed here are my own.
I do not speak for Hyperion, A-EON, or Amiga.org.

I am open for discussion, as long as it appears to be productive.
I have no time for arguing, I have too many other things I could be doing.

Gee, I wonder if Amiga.org has a post length limit? I'll find out when I press "Submit Reply"...

Peace,
LyleHaze
 

Offline LyleHaze

  • Newbie
  • *
  • Join Date: Aug 2013
  • Posts: 39
    • Show all replies
    • https://sites.google.com/site/takeaprogrammertolunch/
Re: Amiga One X 1000 and Xena/Xorro
« Reply #2 on: July 07, 2014, 05:22:05 PM »
I just read my post from last night.. it does sound more like a rant than I would have liked. Maybe I should avoid posting after midnight. ;)

When the topic was first brought up, even some of the XMOS regulars believed the toochain was open. parts of it are, but the "XC" specific extensions are not.
If you're curious, you can read more http://www.xcore.com/forum/viewtopic.php?f=26&t=2137

There are a few in the XMOS clan who prefer PowerPC processors, but the grand majority are there to play with the chips, and would prefer to just use the tools provided.

When I was bringing up the command line tools for AmigaOS, one of the snags I hit turned out to be missing clock configuration information in our compiled projects. The XMOS community (who are generally very capable with these things) had no idea what might be wrong. It turns out that all of the XMOS dev stuff is very thorough about autodetection and autoconfiguration without user intervention of any sort. Tools like this are convenient, but they do contribute to the end user knowing less about how things work. I finally worked it out with Seghers help, and the AmigaOS command line tools were modified to properly set the clock divider correctly. On the other end, I wrote up a config script specifically for Xena, and added it to the XDK, so when we go to start a project, "Amiga X1000_Xena" comes up as an option when selecting the target chip.
Of course, it's not shipped from XMOS that way, but it's (now) easy to add in.

More thoughts about Xena projects:
The ability to do VERY accurate time measurements would make it ideal for ultrasonic measurements.
It would also be VERY simple to make a IR Remote control recorder/playback programs, even better if you choose to support the Pronto format. This would allow loading/saving remotes from a large existing community..
Granted, neither of these is "the killer application", but both could be a lot of fun to play with. Honestly the Pronto project would be made SO simple with the programmable clocks in the Xena chip.

And about the compiler.. I have wondered a few times about "cloud processing" to help us out. I wonder how hard, or how expensive, it would be to set up a virtual machine hosted at some internet company.. and use it just for compiling Xena code for Amiga-folk. I have discussed similar ideas in the XMOS forums, and no objections were raised by the company. If it helps them expand the user base (or just shut me up) then it's good for everyone.
_somebody_ would need to pay some monthly fee for processor time used.. but I suspect the total CPU hours per month would be quite low.. it would certainly be worth looking in to, anyway.
This networking stuff is way over my skill set. I was proud to get ethernet working on my classic 4000, and have never looked deeper since then. I wonder if anyone in our community has the knowledge to discuss these options?

Back to work...
 

Offline LyleHaze

  • Newbie
  • *
  • Join Date: Aug 2013
  • Posts: 39
    • Show all replies
    • https://sites.google.com/site/takeaprogrammertolunch/
Re: Amiga One X 1000 and Xena/Xorro
« Reply #3 on: July 14, 2014, 07:08:04 PM »
Quote from: OlafS3;768918
...
I have read first time about JTAG. If I understand it right it is only to test everything.

http://de.wikipedia.org/wiki/Joint_Test_Action_Group (German)

here is a interesting discussion with one known person involved :-)

http://www.xcore.com/forum/viewtopic.php?f=44&t=2477


The original purpose of JTAG was to allow board manufacturers the ability to test assembled boards with a minimal hardware interface. By chainging them serially and setting a common interface spec even dissimilar chips can be polled and verified in a single JTAG loop.

As used with XMOS chips like Xena, which usually keep the executable code in RAM, it allows that ram to be programmed, and also allows setting of various configuration options such as links between cores(tiles), PLL clock divider settings, and other various details required to get a XS1-L16A chip up and running.

Within the realm of hobbyists, the XMOS chips are almost exclusively run this way, since the OTP ROM is, well.. One Time programmable. It'as not flash, and once it has been progframmed, that chip is committed to that code forever.

Obviously Flash would be more hobbyist-friendly, but it would also create security concerns for any commercial products made with XMOS chips.

Getting back towards the topic(s)..
The non-Amiga XMOS hobbyists are largely oblivious to all these JTAG details. The XDK suite provided by XMOS will seek out XMOS compatible JTAG programmers on startup, then access those to get ChipID's, and often board IDs from the JTAG device. Net result, it's all super-automatic, hands-off, and self managed. Just plug your stuff in and everything is configured automatically. All of this is wonderfully convenient, but it leaves those with non-XMOS kit out in the cold, so to speak.

The discussion you referenced is about one of the "new" products from XMOS. They are now building the USBtoJTAG directly into their newer kit, and doing it in a way that can NOT be easily reached from an external JTAG programmer. This means that we will not be able to use these new "StartKits" from an X-Series AmigaOne, because there's no place to connect JTAG to it.
They are meant to be used only on XMOS supported platforms with XMOS authored software.
Eventually a few hackers found a way to (somewhat) get around this, but not without some loss of function.

Veering back towards a topic once more.. JTAG on Xena is required to load any Xena program you wish to run, The JTAG loop is extended to the XORRO board, so that additional XMOS chips can be added at will. The XMOS tools that we have can load code into any number of XMOS chips through this loop, as well as freeze execution and read the current state of all the chips in the JTAG loop. This can be useful for debugging. We can dump RAM, registers, switch states, ROM, lots of stuff I have not yet documented. There is also a XReset command that will drop all connected (or any one connected) chip back into it's inert power-on state. While these are technically command-line tools, they work with tooltypes as well. Any XMOS program that sets XRunXE as it's default tool with load up when double-clicked.

About adding DB connectors to the Xorro board, that is possible, but I would discourage it. Perhaps I am overly cautious, but anything I connect that comes outside of the case will be optically isolated. While this may be overkill, I think it a prudent choice. I have an SD card there now, no need for isolation. I have a MAX3232 chip, which is connected to the serial port inside the case. again, no need for isolation there. But anything that comes outside the case, for joysticks or whatever else, will be isolated on my machine, and I would suggest that others consider it as well.

Intersting thought.. the S/PDIF in and out connections are optical by design, so adding those should be as safe as anyone could hope.. a very easy way to get high bandwidth audio in and out of the Xena chip.

I am being called away..

LyleHaze
 

Offline LyleHaze

  • Newbie
  • *
  • Join Date: Aug 2013
  • Posts: 39
    • Show all replies
    • https://sites.google.com/site/takeaprogrammertolunch/
Re: Amiga One X 1000 and Xena/Xorro
« Reply #4 on: July 15, 2014, 12:09:33 AM »
Quote from: itix;768928
...
Anyway, JTAG is just an interface to debug boards. It can be part of Amiga expansion boards or to anything you can wish for. But you need JTAG programmer cable and software to use JTAG programmer.

True for most computers, but not for A-EON X-Series computers..
we have the JTAG interface built in and pre-wired to the Xena chip.
As to software, we have a basic tool suite for programming and debugging.

... Very handy for software development.
Quote from: itix;768928
To use JTAG debugger you can have graphical development environment or use command line. Command line is just used to upload software, set breakpoints and other stuff you know. The target enviroment itself is not executing those commands.
 
True, but the target XMOS chips are halted for most JTAG operations, which can definitely affect execution.

Quote from: itix;768928
OS4 dont have JTAG software but I believe you can use PC or even some Linux distro on X1K if there are free drivers not locked to x86.
We have basic tools to program or debug XMOS chips, which matches the built in JTAG port connected to those chips. Anything tools coming from XMOS will run on X86 only.

Quote from: itix;768928
So called "classic" Amiga is probably too slow to debug your SW in real time (i.e. to get debug prints via JTAG) but you dont really need fast machine to use JTAG.
XMOS JTAG does not operate in "Real Time", at least not the tools we have.
There are FAR more advanced tools, like XScope, and other neat features available in the "XDE" package.. which can probably emulate Xena just fine, as long as you don't need to emulate the localbus interface. The XTools are very pretty, very slick, very capable, and they do a great job of isolating you from the actual process.. which some people will admire, and some others may not be happy with.
But if you have a Win or some specific Linux flavors available, by all means download their XDE and give it a spin! I can even offer an "A-EON_Xena.xn" file which will yield correctly configured binaries.  I also have a "printf" replacement that streams out a serial port on Xena (if you have added a serial port)
I was also informed yesterday that Segher has completed newlib, though I don't know if it is "c", "xc", or both.

Quote from: itix;768928
But as usual your problem is lack of software and lack of drivers to use JTAG programmers. I dont think there is going to be any.

We have our basic JTAG tools, and everyone with an X-Series AmigaOne has the Xena, JTAG, and everything else in place already. All they need is a Xorro board to reach the open I/O..
And I have been told that once projects are available, AmigaKit will offer boards that are pre-built to the customers needs. (Great for coders who don't know which end of a soldering iron to hold) *see note*

Despite repeated campaigning on my part, XMOS is not showing any inclination to port their XDE to the Amiga. We would need a mature Java foundation to run Eclipse anyway. But there is always the option of developing under a simulator in XDE and then bringing the result over to AmigaOS for final testing on the real hardware. And there may be other options available in the future.

*Note* the only thing scarier than a programmer with a soldering iron is.. a technician with a flash drive.. Just a bit of humor folks.
« Last Edit: July 15, 2014, 12:37:57 AM by LyleHaze »
 

Offline LyleHaze

  • Newbie
  • *
  • Join Date: Aug 2013
  • Posts: 39
    • Show all replies
    • https://sites.google.com/site/takeaprogrammertolunch/
Re: Amiga One X 1000 and Xena/Xorro
« Reply #5 on: July 15, 2014, 01:42:12 AM »
My apologies, I missed an opportunity to pass useful information.

xTIMEcomposer version Community13.1.0 can be downloaded from
https://www.xmos.com/support/xtools
after a free and simple registration.

Once installed, the user may select
XS1-L16A
as target device if you are interested in Xena compatibility.
There are a few of those devices listed, we have the faster
500MHZ version.

Note: the executable will be missing platform-specific settings
for the PLL, which is fixed by re-compiling against A-EON_Xena.xn.
Otherwise that chip _IS_ the chip used for Xena.

Coders and dreamers alike are welcome to browse the public fora at
http://www.xcore.com/

which are well supported by XMOS employees and users alike.

There's also a free git hub at
http://www.xcore.com/github

and a listing of free projects at
http://www.xcore.com/projects

All easily linked from the main forum pages.

I'm just saying, if you'd rather do than talk, the means are available.

And if you happen to see Segher there, please thank him for supporting our community!

:)
 

Offline LyleHaze

  • Newbie
  • *
  • Join Date: Aug 2013
  • Posts: 39
    • Show all replies
    • https://sites.google.com/site/takeaprogrammertolunch/
Re: Amiga One X 1000 and Xena/Xorro
« Reply #6 on: July 15, 2014, 02:44:14 PM »
Quote from: OlafS3;768974
Interesting stuff and many thanks for your work on it

So you can load code in it? Can you use the official tools (f.e. on windows) to create it? Then you would still need a kind of chain to transfer it from PC to X1000/X5000 to test it there. Or propably more convenient develop and test the code on PC and then transfer it to Amiga and test it there. What XMOS chip is used? Perhaps better to use the same chip and configuration on PC for development and testing and then transfer it and test it on Amiga?


Yes, Yes,Yes,Yes, XS1-L16A.
The X1000 _had_ an XS1-L02, but since then the salesmen have taken liberties with how things are named. The exact same chip is now the XS1-L16A.

The older includes are now deprecated, and they have since renamed threads as cores, cores are now tiles, and a bunch of other changes that seem to be designed just to make conversation awkward. i.e. since "core" had a completely different meaning than it does now, any time it is used the speaker must stop to explain all this renaming mess.

I have _no_ XMOS hardware of any type on my windows machine, I just develop and sim there, and bring the executable over to the X1000 when it's ready for testing on metal.

But every thing you asked is "yes" and has been since October 2012 when I did the public demonstration at AmiWest. I often transfer the executable by FTP, but a flash drive works fine too.
 

Offline LyleHaze

  • Newbie
  • *
  • Join Date: Aug 2013
  • Posts: 39
    • Show all replies
    • https://sites.google.com/site/takeaprogrammertolunch/
Re: Amiga One X 1000 and Xena/Xorro
« Reply #7 on: July 15, 2014, 03:30:53 PM »
Quote from: KimmoK;768981
@xena warrior

Is xena able to generate interrupt to PA6T?
Is PA6T able to generate interrupt to xena?
What is the max bandwidth between PA6T and xena?
Is it possible to do DMA transfer to PA6T RAM from xena?

1>Yes, but I have not yet implemented it.

2>No, there's no such thing as a Xena interrupt pin.  However, one thread(core) of core(tile) One is dedicated to localbus communications, and is addressable as ..16k?.. of flat space. not sure about the size, I'd have to look it up. So there's no need to interrupt it, just perform a read or write to any address that is part of Xenas address range. Note: The range all maps to Xena Space, NOT to RAM.. that space is all comms, not storage.

3> I've forgotten what max bandwidth is on the X1000, it moved around a lot while developing the interface. The interface has been enhanced on Cyrus, but I have not yet had a chance to clock it.

4> No, all Xena memory is internal to the chip, and the only way in is through I/O of some sort.. JTAG is for loading code or debugging, localbus is normally for communication between AmigaOS and Xena tasks..but the I/O is so damned fast that the best way to get high bandwidth in and out is by using chip I/O. The Xena chip is practically all I/O, most can be organized into single bits or groups of 4/8/16 bit groups.
For instance, a simple (no handshaking) serial port needs only two single bits. ANY two single bits of I/O, and if you want only TX or RX then onlly a single IO pin is needed. So you can basically have whatever/as many as you'd like.. the code to make a serial port is just a few lines long, and the speed can go into the megabit range easily.
The SDCard interface uses a couple (3?) individual control bits, plus a 4 bit bus if you choose the wide/fast SDCard interface.

Quote from: KimmoK;768981

I think I lost the link to PA6T-xena-xorro schematic, is it somewhere as free?

It is part of the X1000 technical reference manual. That question is best answered by A-EON.
Quote from: KimmoK;768981

Then, just playing with ideas...
Work for all those cores/threads:
1: Control.
2: Data in. (CPU interface)
3: Data out. (CPU interface)
4: D9-1-io
5: D9-2-io
6: D9-3-io
7: D9-4-io
8: Floppy-control (kryoflux on xcore)
9: Floppy-data
10: i2s-out  / SPDIF
11: i2s-in
12: Fan-Control
13: funky-led-control
14: watchdog (PA6T might have wd built in, but I'm not sure if one can use it on AOS4)
15: parallel-port-out or DA/DIO out or RPi I/O emu or arduino I/O emu. ...
16: parallel-port-in or AD/DAQ in ...

I wonder ... once such SW is loaded to xcore, would it be simple to just configure I/O on the fly (by control process) and then set needed threads/cores to work...

The CPU interface is already implemented. much the rest depends on implementation. while all of it at once might be too much for a single Xena chip, I doubt you'd need all of it at once.. This is where "software defined silicon" comes in.. you just tell it what you want it to be at any given time, and it becomes whatever the code says.
Or you could add more Xena chips, and then extend a link from core1(tile1) so they can all access the localbus interface if needed. But see my previous comments on isolation.

Quote from: KimmoK;768981

guestions galore:
-is it possible to have xena running when PA6T is off/sleep/halted?

A hard reset of the Amiga also resets Xena. A soft reset of the Amiga has no effect on Xena at all. Of course localbus communication requires both sides to be up.
Quote from: KimmoK;768981

out of curiosity, old xena thread @ xmoslinkers: http://archive.xmoslinkers.org/forum/viewtopic.php?t=700


Interesting read, I had not seen that one earlier.
Nice to read a bit from the other side of the fence.
 

Offline LyleHaze

  • Newbie
  • *
  • Join Date: Aug 2013
  • Posts: 39
    • Show all replies
    • https://sites.google.com/site/takeaprogrammertolunch/
Re: Amiga One X 1000 and Xena/Xorro
« Reply #8 on: July 16, 2014, 08:43:52 PM »
Quote from: KimmoK;769098
Thank you for that info! (again)

...a thought about xena->CPU interrupt ... very nice that interrupt can be generated, it would be nice to do interrupt driven things rather than the M$ USB polling methology, there's better use for CPUs than polling interfaces.


It is there, and surely will get used. So far I have really had no need.
The "unique" properties of links on an XMOS chip create certain problems.. Serialized data can flow extremely fast, but will stall for any read without write or write without read.  Ther is no "read until there is no more", as the last read would hang the reader indefinitely.

This _should_ be easy enough to work around, but if your solution is not 100%, then your Xena will hang indefinitely.

As a result, my first projects use a very simple structure where all reads and writes are 16 bits, no matter what, and every transaction between the localbus and the Xena chip is broken down into individual "write then read" loops. This helps keep things simple, but not as fast as they could be at all.

Also a result of this is that I have had no need for interrupts at all yet.

I do have one-directional streaming for higher bandwidth data paths.. but I'm probably gertting into more detail than casual conversation requires.

The line is there, and connected to a GPIO pin on the PA6T. One day when I or someone else needs an interrupt, then progress will be made on this front.
One other user has already inquired about using this line for something else, and I have discoraged that, obviously because once this becomes an interrupt, spurious events for random reasons will not be good for the system.

There is a big list of "stuff to do".. my current project is not a perfect example of properly structured code.. It's more proof of concept than anything else.

There are other users at XCore who are working on a system that will dynamically allocate threads(cores) and also control the switching fabric to allocate their necessary resources, all on the fly. This is obviously better than our current system, which limits us to pre-compiled complete projects.

One possible use that has not yet been mentioned, there is code available for both SHA2 and AES encryption. I'm no crypto guy but having that code available might be useful. I don't know if the X1000 has a guaranteed unique serial number anywhere, but combining that with the crypto stuff could be useful for secure confirmation of machine I.D... and it could be done with no Xorro card or hardware at all.. just what the machine ships with already.

Hell the Xena chip may have a unique ID in itself. that would certainly streamline things. I'll have to look into that.

Nobody loves copy protection, but if it can be done in a way that does not interfere with performance for the registered user, then I don't mind it either.

I need to go.. Nice chatting with you!

LyleHaze
 

Offline LyleHaze

  • Newbie
  • *
  • Join Date: Aug 2013
  • Posts: 39
    • Show all replies
    • https://sites.google.com/site/takeaprogrammertolunch/
Re: Amiga One X 1000 and Xena/Xorro
« Reply #9 on: July 25, 2014, 12:38:17 AM »
Quote from: jaokim;769691
If I don't want to have any extra hardware connected to my X1000, how can I make use of Xena?

Assume I create a simple Xena/XC program (using XTools on Mac/PC) that, for instance, flips all bits of some data. Would it be possible for me to, from AmigaOS, send the bits "000111" and then get "111000" back?

Yes, but it's not quite getting the best of the Xena chip. ;)

First, "XTools" are the AmigaOS tools, "xTIMEcomposer" is the name of their developers kit.

For output from Xena, there are two LEDs on the Nemo board, and another one or two on the Xorro card. But I've heard it too many times, nobody wants to flash LEDs. *

There is also the localbus connection. This is used to write or read 16 bit Words to and from Xena. Each write or read has a large bank of addresses to choose from, which the Xena chip may use to interpret different meanings.. much like ports in networking.
In real hardware it's all going in and out from the same places on Xena side, but the address used may indicate to Xena the purpose of the communication. There is not an established standard protocol for this yet, just the hardware support.

The localbus interface has been improved in the Cyrus board, and as soon as I get a chance I'll work out localbus routines that take full advantage of the improvements in a backwards compatible manner.

Other than that, there is a single bit from Xena to a GPIO of the PA6T, this is intended as an interrupt, and I discourage using it for anbything else. THere is also one "extra" bit going back to the PLD, but I have no idea how to access that, or what effect it might have on the system

In my own opinion, Xenas greatest strength is the ability to stream data very quickly. The localbus interface is not the place for that to happen. I see the localbus mostly as a port for control and feedback from the various processes.

But there is public code for various encryption standards at the XMOS GIT hub. instead of flipping bits you could do sometrhing a bit more useful there.

Quote from: jaokim;769691
Oh, and while I'm at it: how do I transfer programs to Xena, and how do I start it? I kind of get that it might be a stupid question , but I really don't know where to start; it should be possible from AmigaOS, right?


There are a set of XTools for that.
Usually located in Sys:Utilities/Xena/XTools, these command line tools can be used to push code to the Xena chip (xrunxe), or to reset the chip (xreset) or quite a few different views of internal registers. One thing I watch is the program counter of any individual thread.. when this stops moving you can bet that the thread is holding for incoming our outgoing data.. as all channels are blocking by nature.
These tools have been updated a few times, and will be a few more in the near future. Only the very first version released were "wrong".. they did not set the PLL correctly, and as a result the Xena chip ran considerably slower than expected.

The example code you saw does include both the Xena and the AmigaOS sides of the localbus code.. I'm sure you could figure it out after a quick reading.
You should expect the localbus code to be extended to take advantage of the Cyrus improvements at some future time.

*note
Even though flashing LEDs is boring,  with the exceptional speed of Xena I/O, it would be a simple modification to dim LEDs instead.. Simple to do and requires no hardware. Could use localbus to deliver change requests..
Yes, still simple, but it starts with what we have available now, and expands on it gently, which is not a bad way to learn a new language.

And later, with a few constant-current drivers, you could begin to animate your case..

** for the case modders, there is a VERY simple mod available right now that could be fun to play with.. this is NOT Xena related, but (assuming the standard case) you can move the power LED from it's usual header to P31..

With that done, it will light up automatically every power up.. but it is then under command of any program or script you want.. So if you can detect inbox activity, you could make your power LED flash.. or whatever..
It's a very simple hardware link that can be reached easily from any program, but using the executables in Nemo_LED_P31.lha, from OS4Depot.

:)
 

Offline LyleHaze

  • Newbie
  • *
  • Join Date: Aug 2013
  • Posts: 39
    • Show all replies
    • https://sites.google.com/site/takeaprogrammertolunch/
Re: Amiga One X 1000 and Xena/Xorro
« Reply #10 on: July 25, 2014, 06:02:58 PM »
Data processing projects will get the highest throughput if they stream in and out of the Xena chip directly, and use the localbus for control and monitor purposes.

The scenario you described would be pushing all data from Amiga to Xena through the localbus, and getting the results baxck the same way, so not ideal at all.

A few examples of what might work well:

I am working on a data logger that monitors the Debug output stream, and saves the data to an SD Card ON THE XORRO BOARD. After a crash/reboot, or any time really, you can get a directory listing of the files on the SD Card, and retrieve them into Amiga through the localbus. While not a "stellar" example, it removes the need for a second computer to catch the debug stream, and allows at least basic retrieval of log files.

Another good example would be an audio mixer/effects unit.. The Xena chip has no analog inputs or outputs, so those would have to be added to the Xorro card.. OR you could add a couple S/PDIF inputs, and one or more S/PDIF outputs, and do all mixing and effects completely in the digital domain. Note that the "high bandwidth" stuff in both of these are happening directly with the Xena chip, and the Localbus provides monitor and control features.

Another very simple, but fun and useful project would be to write support for recording and playback of Pronto remote control files.. this would make Xena into a learning remote control. Granted the bandwidth is low, usually 40 Khz, but the timing is easily accomplished, and can be easily driven to one or many IR outputs. The entire graphics half of the Pronto files could be adapted into windows and gadgets, so we could import the look and feel of these remotes as well as the function.
Again, the Xena is used for timing critical stuff, and the localbus provides control and monitoring of the chip.

Someone once mentioned making a floppy controller.. it's way over my head, but It would probably be a good project for the author/designer of Catweasel..

The idea of making motor controllers, either servo or stepping, again makes good use of the very fast timing abilities of the chip.

It also occurred to me that distance reading by Sonar, using the old Polaroid ultrasonic transducers for instance, rely on the ability to time events down to a very tight tolerance. The more accurate your timing is, the more better results you get. This would be a perfect match for the Xena chip.. It could not only do it very well, but it can do multiple channels at the same time.. though eliminating crosstalk might be a problem.
Still, it leverages the high speed and accuracy of the XMOS I/O systems to your advantage.

These are just a few examples.. I'm certainly not the most creative person in this community. I look forward to seeing what projects people come up with.
 

Offline LyleHaze

  • Newbie
  • *
  • Join Date: Aug 2013
  • Posts: 39
    • Show all replies
    • https://sites.google.com/site/takeaprogrammertolunch/
Re: Amiga One X 1000 and Xena/Xorro
« Reply #11 on: July 27, 2014, 01:41:14 AM »
Quote from: jaokim;769759
Hmm. The Xorro project board seem to have PCIe x1 slot, besides the Xorro port. I'm assuming this could then be used to transfer data from AmigaOS to the Xorro board; given one has it correctly wired, and configured, and necessary drivers on AmigaOS.


Sure, if you have the knowledge to design and build a PCIe interface, then write AmigaOS drivers for it.. Should be a walk in the the park!:rofl:
Seriously though, building a PCIe interface might be dead easy, I have no idea.

If you were to go that far, look into the hardware specs for an XMOS 5-wire link. This is a ridiculously fast path in and out of the chip. If you can master that, and tie it to PCIe, while the rest of the XMOS community is limited to JTAG over USB. well, that would really put a tilt on the playing field. But while I know _OF_ 5 wire and 2 wire links from a software side, I have no clue what hardware would be needed to support them.. there are lots of XMOS tech reference manuals available though.

Quote from: jaokim;769759

Don't get me wrong here, but if one only has the localbus to communicate with Xena, it seems we might as well only have had an external Xmos startkit, with the proper drivers and tools on AmigaOS of course. I've browsed through some projects at xcore.com, and some seem rather cool. But what I'd really like to see is something that only AmigaOS and the Xorro/Xena combination could pull off, where AmigaOS has an integral role.

Might actually buy that project board, if only for a few blinking led's. :)


The XMOS startkit is only usable from xTIMEcomposer, which has no PPC support and likely never will. If we want cool toys, we'll have to blaze our own trail.

Fun Talk, I'm out for the day.