added v2.0
This commit is contained in:
1
07_Operating_System/03_Sys_Test/GPIO.jack
Symbolic link
1
07_Operating_System/03_Sys_Test/GPIO.jack
Symbolic link
@@ -0,0 +1 @@
|
||||
../GPIO.jack
|
11
07_Operating_System/03_Sys_Test/Main.jack
Normal file
11
07_Operating_System/03_Sys_Test/Main.jack
Normal file
@@ -0,0 +1,11 @@
|
||||
class Main{
|
||||
|
||||
function void main() {
|
||||
while(true){
|
||||
do GPIO.writeLed(GPIO.readLed()+1);
|
||||
do Sys.wait(1);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
18
07_Operating_System/03_Sys_Test/Makefile
Normal file
18
07_Operating_System/03_Sys_Test/Makefile
Normal file
@@ -0,0 +1,18 @@
|
||||
all: jack vm asm bin sim
|
||||
|
||||
jack:
|
||||
../../tools/JackCompiler/JackCompiler.pyc ./
|
||||
vm:
|
||||
../../tools/VMTranslator/VMTranslator.pyc ./
|
||||
asm:
|
||||
../../tools/Assembler/assembler.pyc out.asm
|
||||
bin:
|
||||
../../tools/AsciiToBin.py out.hack
|
||||
sim:
|
||||
cp out.hack ../00_HACK/ROM.hack
|
||||
upload:
|
||||
iceprogduino -o 64k -w out.bin
|
||||
clean:
|
||||
rm -f *.vm *.asm *.hack *.bin *~
|
||||
|
||||
.PHONY: all clean
|
46
07_Operating_System/03_Sys_Test/Readme.md
Normal file
46
07_Operating_System/03_Sys_Test/Readme.md
Normal file
@@ -0,0 +1,46 @@
|
||||
## Sys.jack
|
||||
|
||||
A library that supports various program execution services.
|
||||
|
||||
**Hint:** To debug the next projects in real hardware, we can implement one or both of the following strategies into `Sys.jack`
|
||||
|
||||
1. Use LED to indicate the state of JACK-OS according to
|
||||
|
||||
| LED[1:0] | Sys.jack | JACK-OS state |
|
||||
| -------- | -------------- | ---------------------------------- |
|
||||
| 00 | at entry | nothing happened yet |
|
||||
| 01 | Sys.init() | start execution of Main.main() |
|
||||
| 10 | Sys.halt() | Main.main() terminated succesfully |
|
||||
| 11 | Sys.error(int) | a system error occured |
|
||||
|
||||
2. We can use UART to send some chars according to the state of JACK-OS. e.g. send "GO" at `Sys.init()`, "HALT" at `Sys.halt()` and "ERR" at `Sys.error(int)`.
|
||||
|
||||
***
|
||||
|
||||
### Project
|
||||
|
||||
* Implement `Sys.jack`
|
||||
|
||||
* Test in simulation. Change the delay time in `Main.jack` to 1ms.
|
||||
|
||||
```
|
||||
$ cd 03_Sys_Test
|
||||
$ make
|
||||
$ cd ../00_HACK
|
||||
$ apio clean
|
||||
$ apio sim
|
||||
```
|
||||
|
||||
* Check, if the LED toggles every 1 milli second:
|
||||
|
||||

|
||||
|
||||
* run in real hardware. Set the delay to 1s = 1000ms with `Sys.wait(1000)` in `Main.main()`.
|
||||
|
||||
```
|
||||
$ cd 03_Sys_Test
|
||||
$ make
|
||||
$ make upload
|
||||
```
|
||||
|
||||
* Check if the LED change state every 1 second.
|
40
07_Operating_System/03_Sys_Test/Readme.md.backup
Normal file
40
07_Operating_System/03_Sys_Test/Readme.md.backup
Normal file
@@ -0,0 +1,40 @@
|
||||
## Sys.jack
|
||||
A library that supports various program execution services.
|
||||
***
|
||||
## Project
|
||||
* Implement `Sys.jack`
|
||||
* Test in simulation. Change the delay time in `Main.jack` to 1ms.
|
||||
```
|
||||
$ cd 03_Sys_Test
|
||||
$ make
|
||||
$ cd ../00_HACK
|
||||
$ apio clean
|
||||
$ apio sim
|
||||
```
|
||||
|
||||
Check, if the LED toggles every 1 milli second:
|
||||
|
||||

|
||||
|
||||
* run in real hardware. Set the delay to 1s = 1000ms with `Sys.wait(1000)` in `Main.main()`.
|
||||
```
|
||||
$ cd 03_Sys_Test
|
||||
$ make
|
||||
$ make upload
|
||||
```
|
||||
|
||||
* Check if the LED change state every 1 second.
|
||||
|
||||
**Hint:** To debug the next projects in real hardware, we can implement one or both of the following strategies into `Sys.jack`
|
||||
|
||||
|
||||
1. Use LED to indicate the state of JACK-OS according to
|
||||
|
||||
|LED[1:0]|Sys.jack |JACK-OS state |
|
||||
|------|-|-------|
|
||||
|00 |at entry|nothing happened yet|
|
||||
|01 |Sys.init()|start execution of Main.main()|
|
||||
|10 |Sys.halt()|Main.main() terminated succesfully|
|
||||
|11 |Sys.error(int)|a system error occured|
|
||||
|
||||
2. We can use UART to send some chars according to the state of JACK-OS. e.g. send "GO" at Sys,init(), "HALT" at Sys.halt() and "ERR<digit>" at Sys.error(int).
|
1
07_Operating_System/03_Sys_Test/Sys.jack
Symbolic link
1
07_Operating_System/03_Sys_Test/Sys.jack
Symbolic link
@@ -0,0 +1 @@
|
||||
../Sys.jack
|
1
07_Operating_System/03_Sys_Test/UART.jack
Symbolic link
1
07_Operating_System/03_Sys_Test/UART.jack
Symbolic link
@@ -0,0 +1 @@
|
||||
../UART.jack
|
BIN
07_Operating_System/03_Sys_Test/sys.png
Normal file
BIN
07_Operating_System/03_Sys_Test/sys.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 60 KiB |
Reference in New Issue
Block a user