leafvmaple / vscode-nand2tetris

Language support for Nand2Tetris.
MIT License
10 stars 12 forks source link

Updates to ALU-nostat.hdl are not detected, unless ALU.hdl is modified #4

Closed 64kramsystem closed 4 years ago

64kramsystem commented 4 years ago

I'm working on the simplified ALU in project 2 (ALU-nostat), however, I've found an odd behavior.

I've created a file called ALU-nostat.hdl, with the contents attached.

However, what happens is that, unless I perform modifications to ALU.hdl, when running the code, the out file is not updated.

To reproduce:

  1. Save the attached file as ALU-nostat.hdl in the project/02 directory
  2. Run the code; the output file will have 0000000000000000 in the output pin
  3. Convert the (only) part to be Or16(a=false, b=true, out=out);
  4. Run the code; the output file won't change
  5. Open ALU.hdl and save it with any modification
  6. Run ALU-nostat.hdl
  7. The output file will now have 1111111111111111 in the output pin
64kramsystem commented 4 years ago

It turns out, for making this approach work (that is, to use a ALU-nostat.hdl, one needs to modify the corresponding .tst file:


diff --git a/projects/02/ALU-nostat.tst b/projects/02/ALU-nostat.tst
index 27bc761..45aa603 100644
--- a/projects/02/ALU-nostat.tst
+++ b/projects/02/ALU-nostat.tst
@@ -16,7 +16,7 @@
 // This way, any comparison failures during ALU.tst will be caused by errors in
 // the handling of the 'zr' and 'ng' status outputs.

-load ALU.hdl,
+load ALU-nostat.hdl,
 output-file ALU-nostat.out,
 compare-to ALU-nostat.cmp,
 output-list x%B1.16.1 y%B1.16.1 zx%B1.1.1 nx%B1.1.1 zy%B1.1.1```

Not a bug. Sorry again :slightly_smiling_face: