<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Observations from Uppsala &#187; DML</title>
	<atom:link href="http://jakob.engbloms.se/archives/tag/dml/feed" rel="self" type="application/rss+xml" />
	<link>http://jakob.engbloms.se</link>
	<description>Computer Technology: Simulation, Virtualization, Virtual Platforms, Embedded, Multicore and Multiprocessing (by Jakob Engblom)</description>
	<lastBuildDate>Sun, 29 Jan 2012 19:45:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<image>
    <title>Observations from Uppsala</title>
    <url>http://jakob.engbloms.se/favicon.png</url>
    <link>http://jakob.engbloms.se</link>
    <width>32</width>
    <height>32</height>
    <description>Observations from Uppsala - http://jakob.engbloms.se</description>
    </image>		<item>
		<title>Describe is not the same as Design</title>
		<link>http://jakob.engbloms.se/archives/1083?&#038;owa_medium=feed&#038;owa_sid=</link>
		<comments>http://jakob.engbloms.se/archives/1083#comments</comments>
		<pubDate>Mon, 15 Feb 2010 20:56:41 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[computer simulation technology]]></category>
		<category><![CDATA[EDA]]></category>
		<category><![CDATA[ESL]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[virtual platforms]]></category>
		<category><![CDATA[DML]]></category>

		<guid isPermaLink="false">http://jakob.engbloms.se/?p=1083</guid>
		<description><![CDATA[The discussion on my previous blog post about &#8220;the ideal ESL language&#8221; made me think some more about the purpose of a hardware modeling or description language. If you look closely, you realize that there are two quite different goals being pursued by the tools and languages discussed there. On one hand, we have the [...]]]></description>
			<content:encoded><![CDATA[<p>The discussion on my previous blog post about &#8220;<a href="http://jakob.engbloms.se/archives/1008">the ideal ESL language</a>&#8221; made me think some more about the purpose of a hardware modeling or description language. If you look closely, you realize that there are two quite different goals being pursued by the tools and languages discussed there.</p>
<p>On one hand, we have the task of supporting the design of new hardware bits, for the purpose of creating it. On the other hand, we have the task of describing a particular design for the purpose of simulating it. These two are not necessarily the same.</p>
<p><span id="more-1083"></span>To use an <a href="http://jakob.engbloms.se/archives/1035">analogy with building a house</a>, a design language helps the architect create the house (piece of hardware). Since the architect relies on craftsmen and experts (compilers) to do detailed design (how to put in windows, where to put light switches, etc.), the high-level description does not contain all the details of the house. However, if you are trying to simulate the house (piece of hardware) so that its inhabitants (software) don&#8217;t see the difference to the real thing, the details are sometimes what matters most. For example, the precise way to operate the stove in the house is very important for familiarity, but is a detail most likely left out of the architect&#8217;s initial drawings.</p>
<p>A design language can leave many things unspecified to be filled in by a compiler, but these things can be absolutely core to a description language. In particular, programming register maps tend to be created as a not-too-important side activity in hardware design. They do not really need to be visible in higher-level ESL languages, as they can obviously be filled in later by a tool or a human. But for a description language, they are absolutely core.</p>
<p>A description language can also leave out many parts of the hardware. If the software being used or written does not use certain modes or functions of a piece of hardware, those pieces can be ignored and implemented as dummies. That means that support for dummies is very important in description languages. But dummies make little sense in a design language, as you are unlikely to design a chip with lots of area spent on dummy functions that do nothing.</p>
<p>A description language can also ignore crucial aspects like power constraints and synthesis constraints. These are guidelines for a compilation step that has no bearing on the description of the hardware &#8212; the description language should describe what ended up happening, not the if, please, what, and buts that guided how we got there.</p>
<p>For virtual platform creation, you seem to need a bit of both. I maintain that most of a VP is based on old hardware that exists, which calls for languages with strong description abilities. That&#8217;s the space that <a href="http://jakob.engbloms.se/archives/99">Simics DML </a>was designed for. For the small part of the hardware that is novel would be nice to have some way to convert from a design language to a virtual platform. Here, I don&#8217;t really see any usable current tools or languages &#8212; SystemC is really more a design language, but if you want a virtual platform model, you have to use it as a description language. There is no automagic getting to a fast abstract model from a design-oriented description. That&#8217;s why we need new, higher level systems, that can push out decent descriptions from a design.</p>
<div class="simple_likebuttons_container_small">
      <div class="simple_likebuttons_googleplus">
        <g:plusone size="medium" count="false" href="http://jakob.engbloms.se/archives/1083"></g:plusone>
      </div>
    
      <div class="simple_likebuttons_twitter simple_likebuttons_twitter_s">
        <a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-url="http://jakob.engbloms.se/archives/1083" data-lang="en">Tweet</a>
      </div>
    
      <div class="simple_likebuttons_facebook">
        <div id="fb-root"></div>
        <script>(function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) {return;}
          js = d.createElement(s); js.id = id;
          js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
          fjs.parentNode.insertBefore(js, fjs);
        }(document, "script", "facebook-jssdk"));</script>
        <div class="fb-like" data-href="http://jakob.engbloms.se/archives/1083" data-send="false" data-layout="button_count" data-show-faces="false" data-width="90"></div>
      </div>
    </div>]]></content:encoded>
			<wfw:commentRss>http://jakob.engbloms.se/archives/1083/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Notes from the IP 08 Panel</title>
		<link>http://jakob.engbloms.se/archives/440?&#038;owa_medium=feed&#038;owa_sid=</link>
		<comments>http://jakob.engbloms.se/archives/440#comments</comments>
		<pubDate>Sat, 06 Dec 2008 20:31:46 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[appearances]]></category>
		<category><![CDATA[computer simulation technology]]></category>
		<category><![CDATA[conferences]]></category>
		<category><![CDATA[EDA]]></category>
		<category><![CDATA[ESL]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[virtual platforms]]></category>
		<category><![CDATA[clock-cycle models]]></category>
		<category><![CDATA[DML]]></category>
		<category><![CDATA[IP08]]></category>
		<category><![CDATA[panel discussion]]></category>
		<category><![CDATA[Register Design Languages]]></category>
		<category><![CDATA[Simics]]></category>
		<category><![CDATA[SystemC]]></category>
		<category><![CDATA[SystemRDL]]></category>

		<guid isPermaLink="false">http://jakob.engbloms.se/?p=440</guid>
		<description><![CDATA[Now I am home again, and some days have passed since the IP 08 panel discussion about software and hardware virtual platforms. This was an EDA hardware-oriented conference, and thus the audience was quite interested in how to tie things to hardware design. Any case, it was a fun panel, and Pierre Bricaud did a [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-366" style="margin: 5px 10px;" title="ip08" src="http://jakob.engbloms.se/wp-content/uploads/2008/12/ip08.gif" alt="" width="147" height="63" />Now I am home again, and some days have passed since the <a href="http://www.design-reuse.com/ip08/program/panel_virtualplatform.html">IP 08 panel discussion </a>about software and hardware virtual platforms. This was an EDA hardware-oriented conference, and thus the audience was quite interested in how to tie things to hardware design. Any case, it was a fun panel, and Pierre Bricaud did a good job of moderating and keeping things interesting.</p>
<p><span id="more-440"></span></p>
<p>The panel had a clear consensus, which nobody really challenged, that virtual platforms for software development are different in kind from virtual platforms for hardware development. Indeed, a the taxonomy of &#8220;hardware virtual platforms&#8221; versus &#8220;software virtual platforms&#8221; was used frequently and proved quite appropriate.</p>
<p>A software virtual platform has to be fast and its timing can be fairly approximate. It main value, in this context, is that can be created quickly and is useful for early software development and debug. Opinions differed, however, on how to produce them and where to go with them.</p>
<ul>
<li>Markus Willems from Synopsys had the position that they are produced in some appropriate way as a separate task from hardware development. SystemC was his language of choice.</li>
<li>Peter Flake proposed a methodology where you start by developing the software virtual platform and then refine it down towards more detailed models and finally hardware. He brought up Virtutech <a href="http://www.virtutech.com/whitepapers/virtutech_dml.html">DML </a>and <a href="http://jakob.engbloms.se/archives/358">SystemRDL</a>, as examples of languages pointing in this direction.</li>
<li><strong> </strong>Loic Le Toumelin considered the software virtual platform as a something that is generated from a common design entry point, using some form of synthesis that can also generate the hardware and the hardware virtual platform.</li>
<li>I think my realistic position right now is that a software virtual platform is created as a separate item, but that we want to make this work as short and easy as possible and that in the future, the vision is similar to Peter Flake&#8217;s: start with a software virtual platform to define the hardware-software interface.</li>
</ul>
<p>It was also interesting in how different the opinion was when we got to the detailed hardware-oriented virtual platforms. The ones that tend to be clock-cycle level and attempt to be cycle-accurate (CA) in many cases.</p>
<ul>
<li>Markus said that the only good way to build a CA model was to take the RTL and convert it, or run it in an FPGA prototype. He echoed the sentiments <a href="http://jakob.engbloms.se/archives/153">I wrote about in July, that ARM is getting out of cycle-accurate models and the general difficulty of creating such a model by hand</a>.</li>
<li>Peter pointed out that you can have CA models before RTL, as a design tool. I strongly agree with this model of working, it is common in industry and definitely one way to go. However, for existing hardware, I agree that RTL-to-CA seems reasonable, even if the resulting models are painfully slow.</li>
<li>Loic wanted the CA to come from the same source as the software VP, and was very keen on their being in complete agreement on semantics of the hardware.</li>
</ul>
<p>The third major discussion was about the required accuracy and fidelity-to-hardware of a virtual platform. With a consensus that a software virtual platform has to be fast and with timing approximated, it is still clear that many people are uncomfortable about this idea of not being &#8220;exactly like the hardware&#8221;.</p>
<p>For some purposes, you do need complete fidelity to the hardware timing in a CA model. Loic definitely could not accept anything less when giving a customer a virtual platform, and some people in the audience echoed the same sentiment. Most, however, agreed that most software work can be done with simple timing, and that it does not matter all that much if there are some functionality bugs or omissions in the virtual platform. It is still far better than no platform at all!</p>
<p>What is clearly needed, at least for virtual platforms close to a hardware design process, is a way to check the software virtual platform and hardware virtual platform against the functionality and maybe timing of the final RTL. In the cases that you have the RTL, which is far from always in my world.</p>
<p>There were some other questions about software development tools support (of course you use the same debugger and compiler as with a physical platform) and other issues where the panel was mostly in agreement. I guess some of this also indicates that virtual platforms are not yet universally understood and that most people have not really had any experience with them.</p>
<p>Overall, this was a fun panel, and I hope the audience enjoyed it too and learnt something in the process.</p>
<div class="simple_likebuttons_container_small">
      <div class="simple_likebuttons_googleplus">
        <g:plusone size="medium" count="false" href="http://jakob.engbloms.se/archives/440"></g:plusone>
      </div>
    
      <div class="simple_likebuttons_twitter simple_likebuttons_twitter_s">
        <a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-url="http://jakob.engbloms.se/archives/440" data-lang="en">Tweet</a>
      </div>
    
      <div class="simple_likebuttons_facebook">
        <div id="fb-root"></div>
        <script>(function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) {return;}
          js = d.createElement(s); js.id = id;
          js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
          fjs.parentNode.insertBefore(js, fjs);
        }(document, "script", "facebook-jssdk"));</script>
        <div class="fb-like" data-href="http://jakob.engbloms.se/archives/440" data-send="false" data-layout="button_count" data-show-faces="false" data-width="90"></div>
      </div>
    </div>]]></content:encoded>
			<wfw:commentRss>http://jakob.engbloms.se/archives/440/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Gary Stringham on Hardware Interface Design vs Virtual Platforms</title>
		<link>http://jakob.engbloms.se/archives/358?&#038;owa_medium=feed&#038;owa_sid=</link>
		<comments>http://jakob.engbloms.se/archives/358#comments</comments>
		<pubDate>Sat, 29 Nov 2008 20:51:55 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[EDA]]></category>
		<category><![CDATA[embedded software]]></category>
		<category><![CDATA[ESL]]></category>
		<category><![CDATA[virtual platforms]]></category>
		<category><![CDATA[DML]]></category>
		<category><![CDATA[embedded]]></category>
		<category><![CDATA[Semifore]]></category>
		<category><![CDATA[simulation]]></category>
		<category><![CDATA[Spectareg]]></category>
		<category><![CDATA[SystemRDL]]></category>

		<guid isPermaLink="false">http://jakob.engbloms.se/?p=358</guid>
		<description><![CDATA[I just read an interesting paper from the 2004 Embedded System&#8217;s Conference (ESC) written by Gary Stringham. It is called &#8220;ASIC Design Practices from a Firmware Perspective&#8221; and straddles the boundary between hardware design and driver software development. It was good to see someone take the viewpoint of &#8220;how you actually program a hardware device [...]]]></description>
			<content:encoded><![CDATA[<p>I just read an interesting paper from the 2004 Embedded System&#8217;s Conference (ESC) written by <a href="http://www.garystringham.com">Gary Stringham</a>. It is called &#8220;ASIC Design Practices from a Firmware Perspective&#8221; and straddles the boundary between hardware design and driver software development. It was good to see someone take the viewpoint of &#8220;how you actually program a hardware device is as important as what it does&#8221;. Gary seems to understand both the hardware design and implementation view of things, as well as that of the embedded software engineer. To me, that seems to be a fairly rare combination of skills, to the detriment of our entire economy of computer system development.</p>
<p><span id="more-358"></span></p>
<p>Gary Stringham&#8217;s lists a number of tips on how to create hardware-software interfaces. Some of them are echoed on his <a href="http://www.garystringham.com/newsletter.shtml">monthly newsletter</a>, which is worth a read (even if it is a bit short on detail). Unfortunately, there seems to be no publicly available version of the text. Gary has definitely kept lecturing on the topic since, at venues like the ESC and DVCon it seems, but more recent lecture notes that I have found in the ESC proceedings are pretty sparse. I guess being a consultant teaching people to do these things for a fee makes you a bit hesitant to share all your knowledge freely with the world&#8230; I can understand that position.</p>
<p>Anyway. Some of the comments in the text indicate to me the great value that virtual platforms can bring to the actual design of hardware up front, not just as an execution vehicle for the final design, used by a software engineer who has to take whatever is given.</p>
<p>In particular, the issue of getting ASIC and Firmware designers to collaborate on the same thing at the same time. Quote:</p>
<blockquote><p>The key to designing an ASIC is to get the firmware engineers involved early. They are the customers that will be using the ASIC. Unfortunately, getting them involved early is often difficult to do because the ASIC design has to start several months before the firmware engineers will get parts</p></blockquote>
<p>And</p>
<blockquote><p>When the parts do arrive, the roles are reversed. The firmware engineers are trying to work with<br />
it while the ASIC engineers have mainly forgotten it and have moved on to new projects.</p></blockquote>
<p>The proposed solution to this problem is to involve the firmware people in the hardware design review process, which is a good idea.</p>
<p>It would be even better, however, if the firmware people could have the hardware interface to try as a live thing rather than just reading the documents. This is exactly what virtual platforms offer: quickly build a fast simple prototype of the interface, and hand it over to the software engineers to try.</p>
<p>This is something that I am currently <a href="http://jakob.engbloms.se/archives/330">exploring in some detail with Simics</a>, and that I wrote a piece about in <a href="http://chipdesignmag.com/display.php?articleId=2720&amp;issueId=31">Chip Design </a>earlier this year. Fundamentally, I think this is feasible, provided that hardware designers do not fret too much about timing details and the precise performance of the final implementation, and focus more on the programming interface design first &#8212; and then later go on and make sure the timing and performance is right.</p>
<p>It is just like software development is supposed to be done: start by designing a useful interface to a piece of functionality, and then add in the details and optimize performance within the boundary of that interface. Of course, the interface might need some adjustments to support certain optimizations, but it is quick and easy to provide a new virtual platform with a new behavior to the software engineer. Much faster than providing a new piece of silicon or even new documentation.</p>
<p>Register design tools like <a href="http://www.denali.com/en/products/systemrdl_about.jsp">SystemRDL </a>(<a href="http://www.arm.com/iqonline/news/marketnews/17617.html">now being standardized by SPIRIT</a>), <a href="http://spectareg.com/">Spectareg</a>, <a href="http://www.semifore.com/">Semifore</a>, etc. all touch on this, but all seem to be lacking the ability to actually describe what a device does beyond some simple basics like software and hardware read/write properties. You really need a full expressive language to write a truly executable model of the hardware (and I like <a href="http://www.virtutech.com/whitepapers/virtutech_dml.html">DML </a>for this).</p>
<div class="simple_likebuttons_container_small">
      <div class="simple_likebuttons_googleplus">
        <g:plusone size="medium" count="false" href="http://jakob.engbloms.se/archives/358"></g:plusone>
      </div>
    
      <div class="simple_likebuttons_twitter simple_likebuttons_twitter_s">
        <a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-url="http://jakob.engbloms.se/archives/358" data-lang="en">Tweet</a>
      </div>
    
      <div class="simple_likebuttons_facebook">
        <div id="fb-root"></div>
        <script>(function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) {return;}
          js = d.createElement(s); js.id = id;
          js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
          fjs.parentNode.insertBefore(js, fjs);
        }(document, "script", "facebook-jssdk"));</script>
        <div class="fb-like" data-href="http://jakob.engbloms.se/archives/358" data-send="false" data-layout="button_count" data-show-faces="false" data-width="90"></div>
      </div>
    </div>]]></content:encoded>
			<wfw:commentRss>http://jakob.engbloms.se/archives/358/feed</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Learning Linux Device Drivers on a Virtual PowerPC</title>
		<link>http://jakob.engbloms.se/archives/330?&#038;owa_medium=feed&#038;owa_sid=</link>
		<comments>http://jakob.engbloms.se/archives/330#comments</comments>
		<pubDate>Sun, 02 Nov 2008 10:02:41 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[embedded software]]></category>
		<category><![CDATA[ESL]]></category>
		<category><![CDATA[teaching]]></category>
		<category><![CDATA[virtual platforms]]></category>
		<category><![CDATA[DML]]></category>
		<category><![CDATA[endianness]]></category>
		<category><![CDATA[freescale]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[operating systems]]></category>
		<category><![CDATA[power architecture]]></category>
		<category><![CDATA[Simics]]></category>

		<guid isPermaLink="false">http://jakob.engbloms.se/?p=330</guid>
		<description><![CDATA[There are times when working with virtual hardware and not real hardware feels very liberating and efficient (not to mention safe). Bringing up, modifying, and extending operating systems is one obvious such case. Recently, I have been preparing an open-source-based demonstration and education systems based on embedded PowerPC machines, and teaching myself how to do [...]]]></description>
			<content:encoded><![CDATA[<p><img class="size-medium wp-image-329 alignleft" style="margin: 5px 10px;" title="penguin-variant" src="http://jakob.engbloms.se/wp-content/uploads/2008/11/penguin-variant.png" alt="" width="100" height="118" /></p>
<p>There are times when working with virtual hardware and not real hardware feels very liberating and efficient (not to mention safe). Bringing up, modifying, and extending operating systems is one obvious such case. Recently, I have been preparing an open-source-based demonstration and education systems based on <a href="http://www.virtutech.com/solutions/virtual_platform/powerpc/freescale/mpc8641d.html">embedded PowerPC machines</a>, and teaching myself how to do Linux device drivers in the process. This really brought out the best in virtual platform use.</p>
<p><span id="more-330"></span></p>
<p>The final result of my efforts will be more public early next year, when the students I have put to work on my Linux-based setup come back and show me what they accomplished (or not). Until then, here are some small tidbits on how easy it is to work with kernel-level code in a virtual machine. Actually, if I had been working on real hardware, I am not that certain that I would have had anything but a bricked machine in front of me &#8212; to put it simply, flash reprogramming seems to hate me, and I have managed to fail or destroy a few embedded boards that have been unlucky enough to cross my path.</p>
<p>The virtual platform was really very helpful to diagnose all the mistakes I made while creating my driver and making it talk to my custom hardware.</p>
<p>First of all, it was dead easy to test a new version of the driver: start the simulation from a checkpoint of a booted and configured machine, load the driver into the target file-system using the Simicsfs backdoor (similar to the VmWare hostfs solution), and then insmod it. This was automated in a script that typed the needed commands on the target-command line with no manual intervention. Each iteration takes a few seconds, which is just as fast an convenient as testing a simple program directly on the host.</p>
<p>Diagnosing what went wrong was greatly facilitated by the simulator: did the driver access the device I had prepared for it? Were values read as expected? Obviously, there were a lot of such cases, I am not the most expert device driver programmer (yet).</p>
<p>Here is one particularly interesting example: I empirically learnt that the Linux kernel &#8220;readl&#8221; function is always reading data little-endian, even on a big-endian machine. You have to use &#8220;readl_be&#8221; to get the big-endian data from a big-endian device attached to a big-endian machine. I guess the behavior makes sense for reuse of drivers across architectures, but it sure confused me when my driver was reading the right register but complaining about bad contents.</p>
<p>The simulator showed the problem very plainly:</p>
<ul>
<li>&#8220;value read is 0xabcd0101 (BE)&#8221;. Ok that looks right.</li>
<li>&#8220;register r3 contains 0x0101cdab&#8221;. Strange, looks like the wrong byte order. WHY I screamed to myself.</li>
<li>Using reverse execution to step back one instruction showed that the load instruction used was a byte-swapping 32-bit access. Aha!.</li>
<li>Go into Linux kernel headers (include/asm/io.h) to find that there were a bunch of other varieties available, and guess that readl_be() was the right solution.</li>
<li>Change device driver code, recompile, and retest. Now it worked.</li>
</ul>
<p>I would have assumed that the book I was using as my guide, the highly-recommended<a href="http://lwn.net/Kernel/LDD3/"> Linux Device Drivers, 3rd edition</a>&#8221; would have told me this. But it did not, as it is annoyingly tied to the horrible standard PC. It could really do with some extra chapters on drivers for PowerPC, ARM, and MIPS (to name some of the most important non-x86 architectures out there).</p>
<p>On the other side of the fence, I am using <a href="http://www.virtutech.com/products/simics-modelbuilder.html">Virtutech DML </a>to do the actual device, and that is working out very well. In my setup right now, I can change the device driver and the hardware it drives, recompile both, and then run an automated test script that starts from a checkpoint, inserts the hardware model in target memory, loads the device driver, and tests it in about five seconds. Very handy, and all completely automatic. The ability to load and insert hardware models on the fly during simulation is really very convenient here &#8212; I would have to have to reboot the target Linux from scratch each time I wanted to add or remove things from the virtual platform hardware setup.</p>
<p>To sum things up, so far, I have learnt quite a lot about doing Linux device drivers and how to setup hardware in a Linux system, and I think it would have been much harder to learn and experiment like I have done had I been stuck with physical hardware (not to mention the plain impossiblity of just inserting a  new piece of hardware in a simple way into a physical system).</p>
<p>It really shows that quite often, virtual hardware is &#8220;even better than the real thing&#8221;.</p>
<p>For fun, here is a screenshot of a complete test run of loading the device driver:</p>
<p><a href="http://jakob.engbloms.se/wp-content/uploads/2008/11/hsi-course-complete-test-run-rebuilt-device-and-driver.png"><img class="aligncenter size-medium wp-image-335" title="hsi-course-complete-test-run-rebuilt-device-and-driver" src="http://jakob.engbloms.se/wp-content/uploads/2008/11/hsi-course-complete-test-run-rebuilt-device-and-driver-300x187.png" alt="" width="300" height="187" /></a></p>
<div class="simple_likebuttons_container_small">
      <div class="simple_likebuttons_googleplus">
        <g:plusone size="medium" count="false" href="http://jakob.engbloms.se/archives/330"></g:plusone>
      </div>
    
      <div class="simple_likebuttons_twitter simple_likebuttons_twitter_s">
        <a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-url="http://jakob.engbloms.se/archives/330" data-lang="en">Tweet</a>
      </div>
    
      <div class="simple_likebuttons_facebook">
        <div id="fb-root"></div>
        <script>(function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) {return;}
          js = d.createElement(s); js.id = id;
          js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
          fjs.parentNode.insertBefore(js, fjs);
        }(document, "script", "facebook-jssdk"));</script>
        <div class="fb-like" data-href="http://jakob.engbloms.se/archives/330" data-send="false" data-layout="button_count" data-show-faces="false" data-width="90"></div>
      </div>
    </div>]]></content:encoded>
			<wfw:commentRss>http://jakob.engbloms.se/archives/330/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>In Praise of Scripting: Something for Modeling as Well?</title>
		<link>http://jakob.engbloms.se/archives/186?&#038;owa_medium=feed&#038;owa_sid=</link>
		<comments>http://jakob.engbloms.se/archives/186#comments</comments>
		<pubDate>Sun, 03 Aug 2008 20:40:51 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[computer simulation technology]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[virtual platforms]]></category>
		<category><![CDATA[C/C++]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[DML]]></category>
		<category><![CDATA[Domain-specific languages]]></category>
		<category><![CDATA[programming languages]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[scripting languages]]></category>
		<category><![CDATA[simulation]]></category>
		<category><![CDATA[software tools]]></category>

		<guid isPermaLink="false">http://jakob.engbloms.se/?p=186</guid>
		<description><![CDATA[In the July 2008 issue of IEEE Computer, there is short article called &#8220;In Praise of Scripting: Real Programming Pragmatism&#8220;, by Ronald P. Loui, a professor at Washington University (WUSTL). The article deals with the issue of what is the appropriate first language to teach new CS (Computer Science) students, and considers that a &#8220;scripting&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p><img class="size-medium wp-image-187 alignleft" style="margin: 5px 10px;" title="ieee-computer" src="http://jakob.engbloms.se/wp-content/uploads/2008/08/ieee-computer.gif" alt="" width="89" height="71" />In the <a href="http://www.computer.org">July 2008 issue of IEEE Computer</a>, there is short article called &#8220;<a href="http://doi.ieeecomputersociety.org/10.1109/MC.2008.228">In Praise of Scripting: Real Programming Pragmatism</a>&#8220;, by <a href="http://www.cs.wustl.edu/~loui/">Ronald P. Loui, a professor at Washington University</a> (WUSTL). The article deals with the issue of what is the appropriate first language to teach new CS (Computer Science) students, and considers that a &#8220;scripting&#8221; langauge like Python or Ruby might be way better than Java (no doubt about that I think).</p>
<p>The interesting material in the article is the background on WHY he thinks that this is the case. He points to the immense popularity and rise of scripting in much of computing land. In the past ten years, it is clear to him (and I would agree with this too mostly) that languages like Perl, PHP, Awk, Ruby, JavaScript, and Python have eclipse Java and C++ as the most interesting and important programming languages for many practical tasks. Especially for web applications, where Java seems to have a presence but noone would dream of using something as clunky and impractical as C.</p>
<p>What can this teach us for the purpose of simulation and the creation of models of computer system hardware for the purpose of simulation? Maybe a fair bit&#8230;</p>
<p><span id="more-186"></span></p>
<p>The reason that scripting languages have gotten so popular is primarily that they let you get the job done faster. In web land, this is due to a few important factors listed or hinted at in the article:</p>
<ul>
<li>The overall code tends to be shorter and more to the point</li>
<li>A tendency to make any value into a string when needed (excellent debugging aid)</li>
<li>Dynamic typing, variables that just appear when needed</li>
<li>Automatic memory management</li>
<li>Ease of handling strings</li>
<li>Most tasks are pretty short</li>
<li>Performance of computation does not matter very much when processors are as fast as they are today and a single disk or network access operations is likely to dominate programming time</li>
</ul>
<p>What the article continues with a discussion that we need to focus on programming language <em>pragmatics</em> rather than syntax or semantics. How <em>practical </em>is the language for the everyday tasks of a programmer? And it seems that simple darwinian evolution has propelled scripting-style languages to the top of heap here. Purity and elegance and deep semantical properties are obviously less important than getting the job done in the shortest time possible.</p>
<p>What can this teach us modeling folks?</p>
<ul>
<li>A key takeaway is the focus on short code. Code has to be short and focused to be quick and easy to write. You should not need to consult several header files and lots of documentation to understand and formulate your code, which is an ill that keeps hitting C and C++ programs.</li>
<li>Memory management has nothing to do in a productive programming environment.</li>
<li>Basic types have to be appropriate to the task at hand.</li>
<li>Syntax has to be concise and powerful.</li>
<li>Dynamic typing is much faster to code with than static typing and variable declarations.</li>
<li>An interactive &#8220;try it out&#8221; environment is preferable to long compile/link/test cycles.</li>
</ul>
<p>Obviously, some of these do not translate well into hardware modeling. Hardware entities tend to have very-well-defined types by nature. If I have a 16-bit register containing a 13-bit counter and three status bits, I cannot very well let that counter be a dynamic variable that can take on any numeric value. Or the atom &#8220;foo&#8221;. It kind of has to be restricted in semantics to how the hardware would behave&#8230; it is not just a &#8220;value&#8221; to be manipulated quite abstractly. Which means that what you probably rather need are types well-suited for the task at hand.</p>
<p>It is also nice if variables can just pop into existence when needed, with the least amount of declaration possible. Another C-family performance killer is the annoying need to declare a function before calling it. That made sense in linearly scanning compilers back in the 1970s, but today, just let the compiler take the entire program into account and find the function. It is not that hard, especially not for the quite small and isolated context that a virtual platform device model is (few device models are more than a few thousand lines of code in my experience).</p>
<p>The interactive nature of scripting is also interesting. The ability to just write new code directly into a running system without an explicit compile usually rests on a virtual-machine approach and does have some cost in terms of performance. And unlike webservers, virtual platforms need all the raw CPU performance they can get! However, it make excellent sense to use an interactive environment to prototype and test things, and then move the resulting code to a harder compile stage.</p>
<p>Right now, we really do not have such a tool at hand. <a href="http://www.virtutech.com/whitepapers/virtutech_dml.html">Virtutech DML </a>is <a href="http://www.scdsource.com/article.php?id=166">in my opinion </a>the most promising step along this road, but it is not really &#8220;perl for modeling&#8221; at this time. SystemC has too many C++ roots to really behave well in this respect&#8230; you get all the drawbacks of explicit memory management, rampant headerfiles, and statically declared types. It might be good to compile, but it sure is an absolute pain to write.</p>
<p>And if we want virtual platforms to really fly, it is not so much &#8220;all about the models&#8221;, but really &#8220;all about model programming&#8221; &#8212; since there is a huge volume of models that need to written out there, and getting the time needed to write these models down is a primary concern. The total work invested in modeling any particular device is what we need to focus on, really.</p>
<div class="simple_likebuttons_container_small">
      <div class="simple_likebuttons_googleplus">
        <g:plusone size="medium" count="false" href="http://jakob.engbloms.se/archives/186"></g:plusone>
      </div>
    
      <div class="simple_likebuttons_twitter simple_likebuttons_twitter_s">
        <a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-url="http://jakob.engbloms.se/archives/186" data-lang="en">Tweet</a>
      </div>
    
      <div class="simple_likebuttons_facebook">
        <div id="fb-root"></div>
        <script>(function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) {return;}
          js = d.createElement(s); js.id = id;
          js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
          fjs.parentNode.insertBefore(js, fjs);
        }(document, "script", "facebook-jssdk"));</script>
        <div class="fb-like" data-href="http://jakob.engbloms.se/archives/186" data-send="false" data-layout="button_count" data-show-faces="false" data-width="90"></div>
      </div>
    </div>]]></content:encoded>
			<wfw:commentRss>http://jakob.engbloms.se/archives/186/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>SCDSource Article on Virtutech DML</title>
		<link>http://jakob.engbloms.se/archives/99?&#038;owa_medium=feed&#038;owa_sid=</link>
		<comments>http://jakob.engbloms.se/archives/99#comments</comments>
		<pubDate>Thu, 10 Apr 2008 06:49:18 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[articles]]></category>
		<category><![CDATA[computer simulation technology]]></category>
		<category><![CDATA[virtual platforms]]></category>
		<category><![CDATA[DML]]></category>
		<category><![CDATA[Functional models]]></category>
		<category><![CDATA[Modeling]]></category>
		<category><![CDATA[scdsource]]></category>
		<category><![CDATA[Simics]]></category>

		<guid isPermaLink="false">http://jakob.engbloms.se/archives/99</guid>
		<description><![CDATA[I have an article at SCDSource.com, about how virtual platform creation needs to become more efficient. And the Virtutech current solution to that issue, DML, Device Modeling Language. There is no need to repeat the contents here, just head over to www.scdsource.com/article.php?id=166 to read it! I really think that DML has something to contribute in [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://jakob.engbloms.se/wp-content/uploads/2008/04/scdsourcelogo.thumbnail.gif" alt="SCD Source Logo" align="left" hspace="10" vspace="10" />I have <a href="http://www.scdsource.com/article.php?id=166">an article</a> at <a href="http://www.scdsource.com/index.php">SCDSource.com</a>, about how virtual platform creation needs to become more efficient. And the Virtutech current solution to that issue, DML, Device Modeling Language. There is no need to repeat the contents here, just head over to <a href="http://www.scdsource.com/article.php?id=166">www.scdsource.com/article.php?id=166</a> to read it! I really think that DML has something to contribute in the world of virtual platforms. We need to find ways to be more efficient about how to create models, and that means creating a better programming language.</p>
<p>So what is SCDSource? Is is a quite good news and analysis site about the electronics industry, EDA, virtual platforms, and other themes close to my heart. SCDSource was started in October 2007, and have produced a series of good and interesting articles since. They tend to actually write articles and not just repeat press releases, and to report form interesting panels at events like DATE, ESC, and Multicore Expo.</p>
<div class="simple_likebuttons_container_small">
      <div class="simple_likebuttons_googleplus">
        <g:plusone size="medium" count="false" href="http://jakob.engbloms.se/archives/99"></g:plusone>
      </div>
    
      <div class="simple_likebuttons_twitter simple_likebuttons_twitter_s">
        <a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-url="http://jakob.engbloms.se/archives/99" data-lang="en">Tweet</a>
      </div>
    
      <div class="simple_likebuttons_facebook">
        <div id="fb-root"></div>
        <script>(function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) {return;}
          js = d.createElement(s); js.id = id;
          js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
          fjs.parentNode.insertBefore(js, fjs);
        }(document, "script", "facebook-jssdk"));</script>
        <div class="fb-like" data-href="http://jakob.engbloms.se/archives/99" data-send="false" data-layout="button_count" data-show-faces="false" data-width="90"></div>
      </div>
    </div>]]></content:encoded>
			<wfw:commentRss>http://jakob.engbloms.se/archives/99/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

