Browse Source

fix default vvp, some doc

master
stefan 5 days ago
parent
commit
8b94c5a15f
  1. 25
      README.md
  2. 6
      jpeg_core_tb_run_plasma.py

25
README.md

@ -1,2 +1,27 @@
# In-Field Testing Using MISR # In-Field Testing Using MISR
## Setup
After cloning this repository, run:
```
git submodule init
git submodule update
```
This project uses [Nix](https://nixos.org) to manage reproducible programming environments.
Run `nix develop` to enter a shell with all necessary software.
If `nix` is not installed, follow this [guide](https://librelane.readthedocs.io/en/stable/installation/nix_installation/index.html). No need to clone `librelane` here, but it is good to set up the `extra-substituters` as described in the guide for using LibreLane in the future (for making layouts with SkyWater 130nm technology).
## Usage
Compile jpeg decoder core using `iverilog` and run RTL simulation of the jpeg decoder core using `vvp`:
```
nix develop
make
uv run jpeg_core_tb_run_plasma.py
```

6
jpeg_core_tb_run_random.py → jpeg_core_tb_run_plasma.py

@ -56,7 +56,6 @@ def run_simulation(jpeg_path, ppm_path, vvp_path):
""" """
Decode jpeg_path into ppm_path with vvp sim.vvp and return the result as a PIL Image. Decode jpeg_path into ppm_path with vvp sim.vvp and return the result as a PIL Image.
""" """
assert os.path.exists(vvp_path), "sim.vvp not found — run 'make sim.vvp' first"
result = subprocess.run( result = subprocess.run(
['vvp', vvp_path, f'+infile={jpeg_path}', f'+outfile={ppm_path}'], ['vvp', vvp_path, f'+infile={jpeg_path}', f'+outfile={ppm_path}'],
@ -112,14 +111,15 @@ def main():
help='Plasma coarsest feature size in pixels (default 32)') help='Plasma coarsest feature size in pixels (default 32)')
parser.add_argument('--save-input', metavar='PATH', help='Save generated JPEG to this path') parser.add_argument('--save-input', metavar='PATH', help='Save generated JPEG to this path')
parser.add_argument('--save-output', metavar='PATH', help='Save RTL output PPM to this path') parser.add_argument('--save-output', metavar='PATH', help='Save RTL output PPM to this path')
parser.add_argument('--vvp-path', metavar='PATH', default='sim.vvp', parser.add_argument('--vvp-path', metavar='PATH', default='jpeg_core_tb.vvp',
help='Path to compiled simulation (default: sim.vvp)') help='Path to compiled simulation (default: jpeg_core_tb.vvp)')
args = parser.parse_args() args = parser.parse_args()
mcu, subsampling_str = (16, '4:2:0') if args.subsampling else (8, '4:4:4') mcu, subsampling_str = (16, '4:2:0') if args.subsampling else (8, '4:4:4')
assert args.width % mcu == 0, f"width {args.width} must be a multiple of {mcu} for {subsampling_str}" assert args.width % mcu == 0, f"width {args.width} must be a multiple of {mcu} for {subsampling_str}"
assert args.height % mcu == 0, f"height {args.height} must be a multiple of {mcu} for {subsampling_str}" assert args.height % mcu == 0, f"height {args.height} must be a multiple of {mcu} for {subsampling_str}"
assert os.path.exists(args.vvp_path), f"{args.vvp_path} not found - run 'make' first"
print(f"input: width={args.width} height={args.height} YCbCr={subsampling_str} q={args.quality} seed={args.seed}") print(f"input: width={args.width} height={args.height} YCbCr={subsampling_str} q={args.quality} seed={args.seed}")
Loading…
Cancel
Save