Skip to content

Conversation

@polybeandip
Copy link
Member

@polybeandip polybeandip commented Apr 12, 2025

This tweaks the simulator to be closer to Rio's semantics in math-land. Namely, it introduces

With these additions, tests/test_enq_deq_equiv.ml offers emperical evidence of the equivalence of our enqueue and dequeue side semantics! To generate Gantt charts from these tests,

  1. run dune test with the environment variable GEN_CSV set to YES: i.e. GEN_CSV=YES dune test
  2. run the script plot.py with python3 plot.py

Additionally, the simulator can also be used by running bin/sim.ml with

dune exec bin/sim.exe <prog> <pcap> <RIO|PIFO>

There are a few other minor contributions; here's a longer log of changes not mentioned above:

  • make plot.py generate Gantt charts from all CSVs in graphs/; remove hardcoded names
  • add programs to test enqueue-dequeue side equivalence in progs/enq-deq-equiv
  • remove various type aliases in frontend/ast.ml
  • make Policy.t look more like Ast.stream
  • remove FIFO removals (i.e. extract_subpol) from Add Union Operator; Update AST #69
  • tweak tests/frontend/test_parsing in accordance with changes to Policy.t
  • convert Pieo and Pieotree modules back to Pifo and Pifotree
  • delete mli files when everything is exposed anyway: e.g. rank.mli, time.mli, topo.mli
  • expose certain types for ease of use: e.g. Rank.t, Time.t
  • purge code for T2T compilation: large chunks of topo.ml
  • close Policy.of_program does not always terminate #73 by fixing Policy.of_program
  • tweak additions from Compiler: convert policy to JSON #75 to work with changes to Policy.t
  • Make tests for both modules Riotree and Pifotree in test_rio_tree.ml and test_pifo_tree.ml
  • Make exception LexerError and have ParserError hold a record of relevant info instead string

- convert PIEO trees back to PIFO trees
- add Rio trees
- switch up the test directory structure
- add missing FIFOs to tests
- and now im sad
- the Gantt charts for enq and deq side RR[fifo[A], fifo[B], fifo[C]]
  match on two_then_three.pcap
- documentation
- remove bin/ since enq-deq tests exists now
- remove trees sub dir of simulator
@polybeandip polybeandip marked this pull request as ready for review April 12, 2025 08:48
Copy link
Member Author

@polybeandip polybeandip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anshumanmohan sorry for the large diff (again); a good deal of this is mostly minor refactoring though.

The footprint of the important changes (dequeue side semantics stuff) is almost entirely localized to

  • riotree.ml(i)
  • control.ml(i)
  • simulate.ml(i)
  • test_rio_tree.ml
  • test_enq_deq_equiv.ml

Of the smaller tweaks, I had a couple deletions I hoped to run by you.

Copy link
Member Author

@polybeandip polybeandip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anshumanmohan Just a heads up: I've merged @csziklai's work from #75 so this PR is ready for review again!

I've also marked some questions that came up for me during the merge

Copy link
Contributor

@anshumanmohan anshumanmohan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!!

@anshumanmohan
Copy link
Contributor

Am I blocking this again, or is ready to go?

@polybeandip
Copy link
Member Author

@anshumanmohan Finally hitting the big green button, sorry it so long!

@polybeandip polybeandip merged commit 7ec7e9a into main May 30, 2025
3 checks passed
@polybeandip polybeandip deleted the dequeue-side-sim branch May 30, 2025 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Policy.of_program does not always terminate

3 participants