-
Parse $ARGUMENTS to extract:
- Program: what to run (command, script, or Makefile target)
- Parameter space: which knobs to tune and their ranges/options (may be incomplete — see step 2)
- Objective metric: what to optimize (and how to extract it from output)
- Constraints: hard limits that must not be violated (e.g., timing must close)
- Timeout: wall-clock budget
- Success criteria: when is the result "good enough" to stop early?
-
Infer missing parameter ranges — If the user provides parameter names but NOT ranges/options, you MUST infer them before exploring:
a. Read the source code — search for the parameter names in the codebase:
- Look for argparse/click definitions, config files, Makefile variables, module parameters, , (SystemVerilog), , etc.
- Extract defaults, types, and any comments hinting at valid values
b. Apply domain knowledge to set reasonable ranges:
| Parameter type | Inference strategy |
|---|
| Cache/memory sizes | Powers of 2, typically 1KB–16MB |
| Associativity | Powers of 2: 1, 2, 4, 8, 16 |
| Pipeline width / issue width | Small integers: 1, 2, 4, 8 |
| Buffer/queue/FIFO depth | Powers of 2: 4, 8, 16, 32, 64 |
| Clock period / frequency | Based on technology node; try ±50% from default |
| Bound depth (BMC/formal) | Geometric: 5, 10, 20, 50, 100 |
| Timeout values | Geometric: 10s, 30s, 60s, 120s, 300s |
| Boolean/enum flags | Enumerate all options found in source |
| Continuous (learning rate, threshold) | Log-scale sweep: 5 points spanning 2 orders of magnitude around default |
| Integer counts (threads, cores) | Linear: from 1 to hardware max |
c. Start conservative — begin with 3-5 values per parameter. Expand range later if the best result is at a boundary.
d.
Log inferred ranges — write the inferred parameter space to
dse_results/inferred_params.md
so the user can review:
markdown
# Inferred Parameter Space
|-----------|--------|---------|---------------|-----------|
| CACHE_SIZE | config.py:42 | 32768 | [8192, 16384, 32768, 65536, 131072] | powers of 2, ±2x from default |
| ASSOC | config.py:43 | 4 | [1, 2, 4, 8] | standard associativities |
| BMC_DEPTH | run_bmc.py:15 | 10 | [5, 10, 20, 50] | geometric, common BMC depths |
e. Boundary expansion — during the search, if the best result is at the min or max of a range, automatically extend that range by one step in that direction (but log the extension).
-
Read the project to understand:
- How to run the program
- Where results are produced (stdout, log files, reports)
- How to parse the objective metric from output
- Current/baseline configuration (if any)
-
Create working directory:
in project root
- — one row per design point
dse_results/DSE_REPORT.md
— final report
dse_results/DSE_STATE.json
— state for recovery
dse_results/inferred_params.md
— inferred parameter space (if ranges were not provided)
- — config files for each run
- — raw output for each run
-
Write a parameter extraction script (
dse_results/parse_result.py
or similar) that takes a run's output and returns the objective metric as a number. Test it on a baseline run first.
-
Run baseline (iteration 0): run the program with default/current parameters. Record the baseline metric. This is the point to beat.