Programming AsAP

Prepare Module 1

$ cd $PPD_PATH/chip/testp/tests
$ mkdir module1
$ cd module1
$ vi module1.assy
$ vi module1.chip
$ vi module1.cfg
$ -o module1.mod

Module Name Module1
Module Description This is module 1
Icon File (press enter)

$ cp module1.mod /net/pizza/2/lib/asapmap/modules/

Prepare Module 2

$ cd $PPD_PATH/chip/testp/tests
$ mkdir module2
$ cd module2
$ vi module2.assy
$ vi module2.chip
$ vi module2.cfg
$ -o module2.mod

Module Name Module2
Module Description This is module 2
Icon File (press enter)

$ cp module2.mod /net/pizza/2/lib/asapmap/modules/

Create & Map Application

$ asapmap
Create this simple application

Map the application using the defaults (Mapping -> Execute)
Save the output module to file (Mapping -> Save Module)

Module Filepath ~/output.mod
Module Name Output
Module Description This is the output

Simulate Output

$ cd $PPD_PATH/chip/testp/tests
$ mkdir output
$ cd output
$ ~/output.mod
$ vi output_input.dat
$ cd $PPD_PATH/chip/testp
$ make TEST=output
$ make run

Preparing the Assembly File

The conversion script and the asapmap code viewer at this time don't support the AsAP 2.0 assembly syntax. You will need to remove all the instructions from your assembly files leaving only "#output" lines. A better alternative may be to turn your instructions into comments in order to preserve them in the final module file after performing the mapping. For very large applications you may benefit from writing a script to automate this process of commenting and uncommenting instructions.

If your assembly files currently use "movi dcmem 18 num" to set the output direction you will need you change these to "#output mask". The script can help automate this process but it currently only supports AsAP 1.0 syntax. This means, like before, you must turn your instruction into comments. If you plan on doing this yourself an example of the conversion is given below:

mov dcmem 18 3 => #output EW

Packaging your Application

There are a few simple ways to package your application, but you must create the application in a way that's easy to store.
  1. First move all your sub-modules into a new directory. Now add each sub-module to the module palette by right clicking on the module palette and selecting "Import Module". After mapping the application save the project file into this new directory. Pack up this new directory with all the sub-modules and the project file contained within it. On the receiving side unpack the directory then do a simple search and replace on the project file to update the absolute paths to each sub-module.
  2. Move your sub-modules into the global module directory (/net/pizza/2/lib/asapmap/modules) changing each sub-module's filename to have a unique prefix or suffix. Now create and map your application as usual. Next move the project file and the sub-modules into a new directory (this will be easier now that you have given each sub-module a unique name). Pack up this directory. On the receiving side simply unpack this directory and move the uniquely named sub-modules into the global module directory.