Index of /~squier/Teaching/HardwareFundamentals/LC3-trunk/src

[ICO]NameLast modifiedSizeDescription

[PARENTDIR]Parent Directory   -  
[   ]lcc.zip 2011-12-09 07:14 369K 
[   ]lc3tools_v12.zip 2011-12-09 07:14 55K 
[TXT]Makefile 2011-12-09 07:14 12K 
[TXT]lc3pre_Language_Exte..>2011-12-09 07:14 3.7K 
[   ]lc3pre 2011-12-09 07:14 2.3K 
[TXT]obj2bin.c 2011-12-09 07:14 1.5K 
[TXT]text2bin.c 2011-12-09 07:14 799  
[TXT]testVerilogCompile_f..>2011-12-09 07:14 797  
[TXT]unix2msEOLN.c 2011-12-09 07:14 419  
[TXT]testVerilogCompile_f..>2011-12-09 07:14 319  
[TXT]testVerilogCompile_f..>2011-12-09 07:14 264  
[DIR]os-src/ 2011-12-09 07:14 -  
[DIR]lcc_annotate/ 2011-12-09 07:14 -  
[DIR]Modules/ 2011-12-09 07:14 -  
[DIR]IO/ 2011-12-09 07:14 -  
[DIR]Assembly_test_code/ 2011-12-09 07:14 -  

lc3/src/README.html

This directory contains:

LC3 ASSEMBLY SOURCE CODE

This directory contains assembly language source code for LC3 user programs or the LC3's OS. Some of our verilog testbenches pre-load LC3 programs into simulated LC3 memory, and the simulation executes them. User programs tests specific parts of the LC3 design by executing specific LC3 instructions that use those parts. Some of these programs rely on the OS code being present in memory.

Assembly language source files are assembled using one of the available assemblers, lc3as. That produces pure binary (not ascii 0's and 1's) LC3 .obj files. Normally, those .obj files would then be loaded into LC3 memory and executed. Simulators such as lc3sim-tk or PennSim.jar load pure binary .obj files. However, when using them with verilog simulation, verilog can only read plain text files. So, we must convert the .obj pure binary to verilog readable .bin text files (ascii 0's and 1's). At simulation time, the verilog testbench code will read the .bin file contents to initialize the simulated LC3's memory.

Verilog simulation of our LC3 design is done in the ../run directory. Some of our verilog testbenches in ../lib/test.jelib expect to find and pre-load "prog.bin" and/or "lc3os.bin" or some other .bin file in ../run. We assemble/convert various LC3 assembly programs via "make prog.bin" or "make lc3os.bin". The resulting .bin files are then moved to ../run so the simulation testbench code can find them at run time.

When writing test programs, we may need to debug the code before we try it out on the LC3 verilog simulation. For that, we use an LC3 debugger-simulator: lcsim or lc3sim-tk or PennSim.jar or src/PattPatel/Simulate.exe. These debugger-simulators do not correspond exactly to our LC3 hardware design, each has its own added or missing features. For instance, none of them implements interrupts. Assembly language source code needs to be assembled to .obj files to use these debuggers, but the additional step of conversion to verilog-readable .bin format is not necessary.

OS code is needed if user programs make TRAP calls such as "halt" (which assemblers translate as if reading "TRAP x25" instead). This directory contains several LC3 OS source codes from different authors. They all correspond closely to the default OS code as found in Patt & Patel's LC3 debugger-simulator, Simulate.exe. However, they are not all identical, and some are written using hardware features not present in Patt & Patel's LC3 design. Our version of LC3 OS code is in lc3os-v1.asm, which is a version of Palsetia's OS code re-written to accomodate our LC3 features. Here are web references for some of these OS code sources:

TOOLS

LC3 KEYBOARD and DISPLAY SIMULATION

This a runtime interface to verilog I/O devices. It connects your physical host's console to the lc3 simulation.

Verilog

Finally, there is also some example verilog testbench code, ".v" and ".vh". Use this to test that you have installed iverilog correctly: copy these verilog sources to ../run, and try "iverilog" on them. See Makefile for details.