ArchC The ArchC Description Language




   

ArchC Quick Start

A) Before starting ...

Make sure you have all the language requirements satisfied. You will also need to install other packages depending on which tool you are planning to use:

If you plan to generate interpreted simulators...

The interpreted simulators requires the software SystemC to be installed. Please download it from www.systemc.org. You need to create an account in order to download it. After login, follow the link "About SystemC" -> Download -> 2.0.1 -> (end of page) systemc-2.0.1.tgz. After downloading it, you can install the package:
$ tar xzf systemc-2.0.1.tgz
$ cd systemc-2.0.1
$ ./configure
$ make
$ make install

If you plan to generate assemblers...

You will need the source distribution of the GNU Binutils (version 2.15 or newer) in order the create the assembler. After downloading it, descompact the package into a directory of your choice:
$ tar xzf binutils-2.16.tar.gz

B) Installing the ArchC package

1. Get the latest ArchC language and tools.

2. Install ArchC into a directory of your choice.
$ tar xzf archc-v*.tgz
$ cd archc
$ make

3. Try a sample architecture model to experience with simulators and/or assemblers. Get the SPARC-V8 model (or choose another model) and install it:
$ cd models
$ tar xzf sparcv8-v*.tgz
$ cd sparcv8

Now follow to section C to generate simulators and/or to section D to generate assemblers.

C) Simulators

This example assumes you have just executed the step 3 from section B.

1. Get the JPEG application compiled for SPARC-V8 to load into the simulator or choose another application, and install it:
$ tar xzf jpeg-sparcv8.tgz

2. You may chose from two kinds of simulator:

Option 1: Create and run an Interpreted Simulator
$ ../../bin/acsim sparcv8.ac -abi
$ make -f Makefile.archc
$ ./sparcv8.x --load=mediabench/jpeg/bin/cjpeg -dct int -progressive -opt -outfile testout.jpeg mediabench/jpeg/input/testimg.ppm

Option 2: Create and run a Compiled Simulator:
$ ../../bin/accsim sparcv8.ac -abi --load=mediabench/jpeg/bin/cjpeg
$ make -f Makefile.archc
$ ./sparcv8.x -dct int -progressive -opt -outfile testout.jpeg mediabench/jpeg/input/testimg.ppm

NOTE: If you want to try the other kind of simulator, before going back to Option 1 or Option 2, first clean the existing simulator files using
$ make -f Makefile.archc distclean

The output file from the "cjpeg" (jpeg coder) target application is "./testout.jpeg". This file can be compared to the reference file "mediabench/jpeg/data/testout.jpeg" from Mediabench and viewed with any jpeg viewer.

D) Assemblers

This example assumes you have just executed the step 3 from section B.

1. Execute the asmgen.sh script with the main ArchC model file and an assembler name:
$ ../../bin/asmgen.sh sparcv8.ac mysparc

2. Build the assembler using the GNU autotools. You will need to create a build and a install directory (the build one can be deleted after the building process). We use binutils-dir to point to the directory where we descompacted the GNU Binutils source tarball (you should replace it with yours):
$ mkdir build-dir
$ mkdir install-dir
$ cd build-dir
$ binutils-dir/configure --target=mysparc-elf --prefix=$PWD/../install-dir
$ make all-gas
$ make install-gas

3. Test the generated assembler:
$ cd ../install-dir/bin
$ ./mysparc-elf-as --archc

4. To assemble a single file, get the sample input for the SPARC-V8, and execute:
$ ./mysparc-elf-as --text-addr=0x100 -o findmax.o findmax.s

5. Additionally, you can try running the generated object file (findmax.o) on a SPARCV8 simulator (as the example in the above section) or see the contents of the file with the readelf tool:
$ readelf --sections findmax.o
$ readelf -x1 findmax.o           (.text section)
$ readelf -x2 findmax.o           (.data section)


Please let us know if you have any problems using ArchC.


 Printable Version

SourceForge.net Logo