Measure completion time for each unbounded proof

This commit is contained in:
Donald Sebastian Leung 2020-11-11 13:59:40 +08:00
parent d5a83a65c8
commit 1d5ee12431
2 changed files with 9 additions and 19 deletions

View File

@ -11,30 +11,13 @@ Formally verified implementation of the ARTIQ RTIO core in nMigen
## Running the verification tasks ## Running the verification tasks
Currently, only the sorting network contains assertions to be verified. To run the verification tasks for the sorting network, change directory to the root of this project, set up the [Nix](https://nixos.org) environment by running `nix-shell` and do To run the verification tasks for the sorting network (unbounded proofs with variable numbers of lanes), change directory to the root of this project, set up the [Nix](https://nixos.org) environment by running `nix-shell` and do
```bash ```bash
$ python -m rtio.test.sed.output_network $ python -m rtio.test.sed.output_network
``` ```
## Progress This should complete in under an hour. The time to complete each verification task (2 lanes, 4 lanes, 8 lanes) is printed to standard output.
- Devise a suitable migration strategy for `artiq.gateware.rtio` from Migen to nMigen
- [x] Implement the core in nMigen
- - [x] `rtio.cri` (`Interface` and `CRIDecoder` only)
- - [x] `rtio.rtlink`
- - [x] `rtio.sed.layouts`
- - [x] `rtio.sed.output_network`
- - [x] `rtio.sed.output_driver`
- [ ] Add suitable assertions for verification
- - [ ] `rtio.cri` (`Interface` and `CRIDecoder` only)
- - [x] `rtio.sed.output_network` - Sorting network (high priority)
- - [ ] `rtio.sed.output_driver`
- [x] Restructure to code to follow nMigen convention and re-validate existing assertions (if any)
- - [x] `rtio.cri` (`Interface` and `CRIDecoder` only)
- - [x] `rtio.sed.output_network`
- - [x] `rtio.sed.output_driver`
- [ ] Simulate RTIO command for switching TTL
## License ## License

View File

@ -2,6 +2,7 @@ from nmigen import *
from nmigen.asserts import * from nmigen.asserts import *
from nmigen.test.utils import * from nmigen.test.utils import *
from ...sed.output_network import * from ...sed.output_network import *
from datetime import datetime
""" """
Verification tasks for OutputNetwork Verification tasks for OutputNetwork
@ -107,14 +108,20 @@ class OutputNetworkSpec(Elaboratable):
class OutputNetworkTestCase(FHDLTestCase): class OutputNetworkTestCase(FHDLTestCase):
def verify(self): def verify(self):
startTime = datetime.now()
self.assertFormal( self.assertFormal(
OutputNetworkSpec(2, 2, [("data", 32), ("channel", 3)]), OutputNetworkSpec(2, 2, [("data", 32), ("channel", 3)]),
mode="prove", depth=latency(2)) mode="prove", depth=latency(2))
print("Verification of sorting network with 2 lanes completed in %f ms" % ((datetime.now() - startTime).total_seconds() * 1000))
startTime = datetime.now()
self.assertFormal( self.assertFormal(
OutputNetworkSpec(4, 2, [("data", 32), ("channel", 3)]), OutputNetworkSpec(4, 2, [("data", 32), ("channel", 3)]),
mode="prove", depth=latency(4)) mode="prove", depth=latency(4))
print("Verification of sorting network with 4 lanes completed in %f ms" % ((datetime.now() - startTime).total_seconds() * 1000))
startTime = datetime.now()
self.assertFormal( self.assertFormal(
OutputNetworkSpec(8, 2, [("data", 32), ("channel", 3)]), OutputNetworkSpec(8, 2, [("data", 32), ("channel", 3)]),
mode="prove", depth=latency(8)) mode="prove", depth=latency(8))
print("Verification of sorting network with 8 lanes completed in %f ms" % ((datetime.now() - startTime).total_seconds() * 1000))
OutputNetworkTestCase().verify() OutputNetworkTestCase().verify()