tag:blogger.com,1999:blog-50517827992574212702024-03-05T14:59:40.036-08:00XMOSRubenhttp://www.blogger.com/profile/05250236263075329566noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-5051782799257421270.post-4459940761259416332011-01-26T10:58:00.000-08:002011-01-26T10:58:26.016-08:00XMOS Bit Scheme @ FOSDEM 2011XMOS Bit Scheme will presented at <a href="http://fosdem.org/2011/schedule/event/multicore">FOSDEM 2011</a>.<br />
<br />
The presentation takes place February 5th at 14h00 and is titled "<a href="http://fosdem.org/2011/schedule/event/multicore">Advanced Experiments with XMOS Multicore Embedded Hardware.</a>"<br />
<br />
Embedded systems handle signals from the outside world using either polling or interrupts. While polling is resource consuming, interrupt-driven approaches can introduce bugs which are subtle and difficult to debug. This talk discusses our experience on porting the Scheme programming language to a new event-driven architecture and programming style developed by the XMOS company. The architecture's hardware support for multithreading enables an event-driven style for programming embedded systems which does not suffer from the drawbacks associated with the use of polling and interrupts. To accomplish this, the thread support is implemented in hardware. Each thread has a dedicated set of registers and is assigned a guaranteed amount of CPU cycles. We first describe how we ported a Scheme interpreter to this new architecture. We exploit the multi-threaded nature of this architecture by running multiple interpreters in parallel, concretely one interpreter on each core. In addition, we extended each interpreter with abstractions to manage this concurrency and to exploit features specific of the XMOS hardware. Such abstractions include sending messages between interpreters over channels. Concretely, our effort enables an event-driven style for programming multi-core embedded systems in Scheme. We show how the XMOS architecture helps the programming in overcoming the difficulties associated with polling and interrupt-driven approaches.Rubenhttp://www.blogger.com/profile/05250236263075329566noreply@blogger.com0tag:blogger.com,1999:blog-5051782799257421270.post-70374762416020304242010-10-03T14:31:00.000-07:002010-10-03T14:31:38.369-07:00Houray!XMOS Bit Scheme has won the "Project Of The Month" award on <a href="http://www.xcore.com/forum/viewtopic.php?f=27&t=743">XCore.com</a>!Rubenhttp://www.blogger.com/profile/05250236263075329566noreply@blogger.com0tag:blogger.com,1999:blog-5051782799257421270.post-49099914274896528722010-09-13T09:18:00.000-07:002010-09-13T09:18:42.840-07:00XMOS BIT Scheme code releasedThe XMOS BIT Scheme code is now available on <a href="http://www.xcore.com/projects/xmos-bit-scheme">XCore Exchange</a> (under the GPL3 license)!Rubenhttp://www.blogger.com/profile/05250236263075329566noreply@blogger.com0tag:blogger.com,1999:blog-5051782799257421270.post-28026737840775026672010-09-05T05:28:00.000-07:002010-09-05T05:28:50.346-07:00XMOS Bit SchemeI've recently finished my thesis titled "Implementing Concurrency Abstractions for Programming Multi-Core Embedded Systems in Scheme" in which I've ported Bit Scheme to the XMOS platform. During the project, I switched from the <a href="http://xcore.com/projects/xmoslisp">XMOSlisp</a>, mentioned before to Bit Scheme which contains much functionality.<br />
<br />
In the following movie you can see a demo application written in Scheme running on an XK-1a development board. This board performs a red-green LED and communicates with another board via XBee. You can find a bit more information about this demo in the presentation below.<br />
<br />
<object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/P6G5kKBqHHs?fs=1&hl=en_US&rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/P6G5kKBqHHs?fs=1&hl=en_US&rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object><br />
<br />
I've also uploaded the slides of my defense online in order to show the basic usage of the XMOS Bit Scheme interpreter.<br />
<br />
<div style="width:425px" id="__ss_5132630"><strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/rubenvdm/05-defense" title="05 defense">05 defense</a></strong><object id="__sse5132630" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=05defense-100905072558-phpapp01&stripped_title=05-defense" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed name="__sse5132630" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=05defense-100905072558-phpapp01&stripped_title=05-defense" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object><div style="padding:5px 0 12px">View more <a href="http://www.slideshare.net/">presentations</a> from <a href="http://www.slideshare.net/rubenvdm">Ruben Vandamme</a>.</div></div>Rubenhttp://www.blogger.com/profile/05250236263075329566noreply@blogger.com0tag:blogger.com,1999:blog-5051782799257421270.post-48821611518545929432010-03-08T03:02:00.000-08:002010-03-08T03:03:11.502-08:00XMOSlisp code availableThe XMOSlisp code is now available on xcore.com<br />
<a href="http://xcore.com/projects/xmoslisp">http://xcore.com/projects/xmoslisp</a><br />
Since the last blogpost, a simple garbagecollector has been added too.Rubenhttp://www.blogger.com/profile/05250236263075329566noreply@blogger.com0tag:blogger.com,1999:blog-5051782799257421270.post-90131997584965610072010-02-28T10:21:00.000-08:002010-03-07T12:52:58.339-08:00Tiny lisp<b>Intro</b> <br />
<br />
Recently I've made progress on having an interpreted language running on the XMOS chip. I've found a small (but incomplete) lisp interpreter which fits in and runs with the limited memory of the chip. By using an interpreted language, programs can be run on the XMOS chip without the need for compilation. Unfortunately it doesn't contain a garbage collector (at this moment), meaning that an inevitable crash awaits a lot of the programs.<br />
<br />
<b>Examples </b><br />
<br />
Primitives for ports and timers are added to allow various IO operations.<br />
For example turning some leds on, on the development board:<br />
<br />
<div style="color: #93c47d;">(pout clockled0 15)</div><br />
This function returns the value set (in this case 15), allowing to chain multiple outputs:<br />
<br />
<div style="color: #93c47d;">(pout clockled0 (pout clockled1 (pout clockled2 15)))</div><br />
Input is also supported using the following methods:<br />
<ul><li>simple read: <span style="color: #93c47d;">(pin button)</span> </li>
<li>pin equal: <span style="color: #93c47d;">(peq button 12)</span></li>
<li>pin not equal:<span style="color: #93c47d;"> (pne button 15)</span></li>
</ul>These methods obviously return the value read from the port allowing combinations like:<br />
<br />
<div style="color: #93c47d;">(pout clockled0 (pne button 15))</div><br />
There is also support for timers. These evaluate to an integer value similar to the way they are used in XC. That way delays can easily be created by doing:<br />
<br />
<div style="color: #93c47d;">(after (+ (timer) 100000000) <i>value</i>)</div><br />
Using these timers the following demo was made. It is a function which is called recursively generating a small animation using the LEDs on the development board. The initial value (being 1) is multiplied by two on every function call, effectively shifting to the next led. The "mod 15", keeps everything in range.<br />
<br />
<div style="color: #93c47d;">((lambda x (apply (car x) x))</div><div style="color: #93c47d;"> (lambda (f n)</div><div style="color: #93c47d;"> (f f</div><div style="color: #93c47d;"> (after (+ (timer) 20000000)</div><div style="color: #93c47d;"> (% (* 2 (pout clockled0 (pout clockled1 (pout clockled2 n)))) 15)</div><div style="color: #93c47d;"> )))</div><div style="color: #93c47d;"> 1</div><div style="color: #93c47d;">)</div><br />
Due to the lack of a garbage collector and the use of recursion, it will run out of memory after about 10-15 seconds.<br />
<br />
<br />
<object height="344" width="425"><param name="movie" value="http://www.youtube.com/v/FIAekX7bI5g&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/FIAekX7bI5g&hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object><br />
<br />
<br />
<b>Parallellism</b><br />
<br />
At this moment there is no way to use the multithreading in the XMOS chip using the lisp interpreter.Rubenhttp://www.blogger.com/profile/05250236263075329566noreply@blogger.com0tag:blogger.com,1999:blog-5051782799257421270.post-42080825949404028092009-12-03T05:27:00.000-08:002009-12-03T05:28:53.243-08:00XMOS XBeeI've recently worked on using XBee(Zigbee) modules for doing wireless communication with the XMOS XC-1 development board. As you may have noticed on the photo, I'm using Arduino breakout boards. These do the voltage conversions from 5 to 3.3 Volt. One of them is directly connected with the XC-1 using a breadboard. The other one is plugged in an empty Arduino board. Its jumpers are placed to USB mode to enable direct IO with my PC.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDkB7QPLjOpE25dU-WnY9QNLmk-qCFTh85WCEuB0LjwG0X8Hpu_apZ0XsE5lhq74wF9OL412489P71bDPJfHqVmbT9VG3r9s76dIuIGYuuV3bPZw2Dd3GiEbQmOurnJihNPDKJnUctV9A/s1600-h/IMG_2139_small.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDkB7QPLjOpE25dU-WnY9QNLmk-qCFTh85WCEuB0LjwG0X8Hpu_apZ0XsE5lhq74wF9OL412489P71bDPJfHqVmbT9VG3r9s76dIuIGYuuV3bPZw2Dd3GiEbQmOurnJihNPDKJnUctV9A/s320/IMG_2139_small.JPG" /></a><br />
</div><br />
<div style="text-align: left;">On the XMOS chip runs a program which allows to set the clock leds to different shades of orange (varying from red to green actually). Therefor it reads commands from the XBee module, logically being 'r' and 'g'. In the video below you can see how it looks like:<br />
</div><br />
<br />
<br />
<br />
<center><br />
<object height="344" width="425"><param name="movie" value="http://www.youtube-nocookie.com/v/iKwONJ7wk-g&hl=en_US&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube-nocookie.com/v/iKwONJ7wk-g&hl=en_US&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></center><br />
<br />
This is how it works behind the scenes:<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjr2t4B2iFptGsZlNSu20LpPhrw463-eDn53_jAe7Qe7O4Hta9LCJnWwmGftnnk_3esTsclSuHzRt4-Z8M7aAbjugjzVVQjziCVM1wQTVuUSr6EDJ0WCnN9V_1WZV28uGZcHmNQlmFmey0/s1600-h/structure.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjr2t4B2iFptGsZlNSu20LpPhrw463-eDn53_jAe7Qe7O4Hta9LCJnWwmGftnnk_3esTsclSuHzRt4-Z8M7aAbjugjzVVQjziCVM1wQTVuUSr6EDJ0WCnN9V_1WZV28uGZcHmNQlmFmey0/s320/structure.jpg" /></a><br />
</div><br />
On the PC side, the XBee module appears as a serial device thanks to the FTDI chip on the Arduino board. When typing a command ('r' or 'g'), it is automatically sent in ascii by the XBee. The other module receives it and sends it to the XMOS chip. This one supports 10 colors ranging from green (value zero) to red (value 10). When the XMOS chip gets a command it will calculate the new value and send it back to the PC via the wireless connection.<br />
The XMOS chip will drive its red and green leds according to the value mentioned above. For example, value 4 means that red will be on for 4 ms and green for 6 ms, creating a shade of orange.Rubenhttp://www.blogger.com/profile/05250236263075329566noreply@blogger.com0tag:blogger.com,1999:blog-5051782799257421270.post-119445343469427562009-11-18T13:17:00.000-08:002009-11-18T14:46:21.268-08:00Presentation about: XMOS XS1 and XCThis week I've given a presentation at my university. The main topics were the XMOS XS1 hardware and XC. With two small examples I show how the special hardware can be programmed using XC.<br />
<br />
<div id="__ss_2530534" style="text-align: left; width: 425px;"><a href="http://www.slideshare.net/rubenvdm/xm-2530534" style="display: block; font-family: Helvetica,Arial,Sans-serif; font-size-adjust: none; font-size: 14px; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; margin: 12px 0pt 3px; text-decoration: underline;" title="XMOS XS1 and XC">XMOS XS1 and XC</a><object height="355" style="margin: 0px;" width="425"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=01cspxcxmos-091118133807-phpapp02&stripped_title=xm-2530534" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=01cspxcxmos-091118133807-phpapp02&stripped_title=xm-2530534" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object><br />
</div>Rubenhttp://www.blogger.com/profile/05250236263075329566noreply@blogger.com0tag:blogger.com,1999:blog-5051782799257421270.post-18743390791791482862009-10-19T07:38:00.000-07:002009-10-19T09:12:16.054-07:00It arrived!<span style="font-size: large;">The hardware</span><br />
<br />
I received my <a href="https://www.xmos.com/products/development-kits/xc-1-development-kit">XC-1 dev kit</a> recently. It came in a nice plastic box which reminds me most of an old VHS tape box. Anyway, its content is way more exciting. It contains the board with XMOSes XS1 chip (plus a usb cable and a quickstart guide).<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkjIFfpqyWbANnr3si2QUCct9G2Wdu8MairRXlLF1usS3QFt6HgZiIEdT6CKUUW0r0NOzhG9i47x1Uf9R4oETFgvJo3Y-rXEcz0onwt8EqJ3QkzjbOvtVGAYqUToLFMKzJoqpKmzbqVsM/s1600-h/IMG_2134_small.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkjIFfpqyWbANnr3si2QUCct9G2Wdu8MairRXlLF1usS3QFt6HgZiIEdT6CKUUW0r0NOzhG9i47x1Uf9R4oETFgvJo3Y-rXEcz0onwt8EqJ3QkzjbOvtVGAYqUToLFMKzJoqpKmzbqVsM/s320/IMG_2134_small.JPG" /></a><br />
</div><br />
On front of the red multilayer PCB shines the XS1 chip surrounded by a "clock" of 12 red/green leds. Next to it there are 4 pushbuttons with accompagning leds and a buzzer. Own periferal hardware can be added using the four expansion ports and a prototype area. The backside is a less exciting: two oscillators, a usb connector and an FTDI chip are found there. The FTDI chip makes the XC1 show up with 2 serial ports on my system. If you want more details about the board, they are all nicely explained in the "<a href="https://www.xmos.com/published/xc1hw">XC-1 Hardware Manual</a>"<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcB2bFxo0wrfWeHHBq-QPFpTPSwaaxGNyImlBExSbt5cFPD7U7-85g7kHG0hiZOCZeDfevhywiLhyy-Op16ZaT8QbOde9rDaCPZuhlGZye5rTPbuMRDBctzIUGb5zOU374z2oUGg0GVLQ/s1600-h/IMG_2136_small.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcB2bFxo0wrfWeHHBq-QPFpTPSwaaxGNyImlBExSbt5cFPD7U7-85g7kHG0hiZOCZeDfevhywiLhyy-Op16ZaT8QbOde9rDaCPZuhlGZye5rTPbuMRDBctzIUGb5zOU374z2oUGg0GVLQ/s320/IMG_2136_small.JPG" /></a><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDJG-vqtJgEPdx-pcPcRRVEox2yx05h3-Z-Q8UpvGph2hunUGhKPKhq8UBYRQinXK4SeLFu_cketurG1TP7Of5VoEEQxY6OI1DZgGGAtoQpSHBKJv3I74c0c-lhlBHG8oRQl9eBaKskEY/s1600-h/IMG_2135_small.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDJG-vqtJgEPdx-pcPcRRVEox2yx05h3-Z-Q8UpvGph2hunUGhKPKhq8UBYRQinXK4SeLFu_cketurG1TP7Of5VoEEQxY6OI1DZgGGAtoQpSHBKJv3I74c0c-lhlBHG8oRQl9eBaKskEY/s320/IMG_2135_small.JPG" /></a><br />
</div><br />
The board is powered through the USB port only, so no need for an extra power supply. Connect it to your computer and it immediately comes alive with a nice demo on its "led clock". There are four other demos provided: a clock, a simple audio synthesizer a reaction game and an uart demo.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1jderi0Wvw4OZgSi6JvaQogNNNHMBHhyphenhyphenjMEw3DlQkDMuckY5hzXNCIVz9ZRKWx6SuezXbshZkWkO2MLsKRsz5nlUjBuImljDjh5mIBhLQiamGa_a1o4Qp95DnF1b8g-pNoRpX63P8WlY/s1600-h/IMG_2137_small.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1jderi0Wvw4OZgSi6JvaQogNNNHMBHhyphenhyphenjMEw3DlQkDMuckY5hzXNCIVz9ZRKWx6SuezXbshZkWkO2MLsKRsz5nlUjBuImljDjh5mIBhLQiamGa_a1o4Qp95DnF1b8g-pNoRpX63P8WlY/s320/IMG_2137_small.JPG" /></a><br />
</div><br />
<br />
<span style="font-size: large;">Getting started</span><br />
<br />
After the demos, it's time to set up the development environment. The provided Quick Start Guide contains a nice step-by-step walktrough to get started. It covers Windows, Mac and Linux.<br />
Installing the toolchain on linux isn't hard either. It basically comes down to <a href="https://www.xmos.com/technology/design-tools">downloading</a> it from the XMOS website and extracting the tar file to your home directory. You shouldn't worry about the "compatible with Redhat 4.6" on their site.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpaYgtes2_l3KCzkbiiA-Nzjt4MBx-Q2N8GJs7qTWd9MLLg9lWxtWn50g8jrI5mB_F-Yq31rgImgsyL2zKvuJ0msEuHfAXbqcBd27iyPU0VIvRNUi2qMNBxGdKfJ3K6Tjl8ipCPfkkQT0/s1600-h/ide.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpaYgtes2_l3KCzkbiiA-Nzjt4MBx-Q2N8GJs7qTWd9MLLg9lWxtWn50g8jrI5mB_F-Yq31rgImgsyL2zKvuJ0msEuHfAXbqcBd27iyPU0VIvRNUi2qMNBxGdKfJ3K6Tjl8ipCPfkkQT0/s320/ide.jpg" /></a><br />
</div><br />
The IDE is Eclipse based, so chances are that you'll feel at home immediately. Everything is nicely integrated. But if you really want you can also use the seperate tools from within a terminal.<br />
<br />
<br />
<span style="font-size: large;">The project</span><br />
<br />
This project is an entry for the <a href="https://www.xmos.com/challenge">XMOS Challenge</a>. The goal of it is to port the in-house developed Scheme interpreter to the XMOS architecture. It will be possible to use it for rapid prototyping or for educational purposes. All XC specific features should be usable directly from Scheme. That way, it can be used to learn and experiment with advanced multicore architectures without having to worry about low level problems. After porting is completed, some programs will be written using the Scheme environment.<br />
<br />
As an intermediate step, <a href="http://pico.vub.ac.be/">Pico</a> will be ported first. Pico is a small derivative of the aforementioned Scheme interpreter.Rubenhttp://www.blogger.com/profile/05250236263075329566noreply@blogger.com0