gnupic: gpsim scripts embedded in .asm source


Previous by date: 25 May 2005 07:02:34 +0100 Re: [gnupic] gpsim 0.21.4 - Mac OS X Tiger - Fink build, Borut Razem
Next by date: 25 May 2005 07:02:34 +0100 Re: [PIC] LPLAB testing with ICD2, Chen Xiao Fan
Previous in thread:
Next in thread:

Subject: gpsim scripts embedded in .asm source
From: "Scott Dattalo" ####@####.####
Date: 25 May 2005 07:02:34 +0100
Message-Id: <62127.67.118.99.39.1117000949.squirrel@67.118.99.39>

Along the same idea of assertions, I used gpasm's .direct directive to
support simulator scripts. This means it is now possible to write a gpsim
script and place it in your .asm source file. When the source file is
assembled and loaded into gpsim, the script will get loaded too and will
be invoked as the last step of the load. This is a convenient way of
maintaining scripts.

If you use Craig's coff.inc include file, then the syntax is:

   .sim "gpsim command"

If you're not using coff.inc, then the syntax is

   .direct "E" "gpsim command"

In both cases, the quoted gpsim command is any valid gpsim command. I'm
now using this as part of the assertion regression test. In that test,
assertions are validate for both passing and failing. The script is very
simple:

   .sim "failures=1"     ; Assume the test fails
   .sim "run"            ; runs to the first assertion (that's designed to
fail)
   .sim "failures=failures+1"
   .sim "run"            ; runs to the second assertion
   .sim "failures=failures+1"
   .sim "run"
   .sim "failures"

But there shouldn't be any reason why you couldn't place stimuli here.

Another benefit of this feature is that you can conditionally generate
scripts. In other words, you can use gpasm's ifdef processing to customize
your scripts.

This still a very new feature and definitely needs to be tested...

Scott

Previous by date: 25 May 2005 07:02:34 +0100 Re: [gnupic] gpsim 0.21.4 - Mac OS X Tiger - Fink build, Borut Razem
Next by date: 25 May 2005 07:02:34 +0100 Re: [PIC] LPLAB testing with ICD2, Chen Xiao Fan
Previous in thread:
Next in thread:


Powered by ezmlm-browse 0.20.