Skip to content

Commit b99858b

Browse files
committed
Update CLI opts
1 parent a2d3282 commit b99858b

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

crates/filament/src/cmdline.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ pub struct Opts {
5757
#[argh(option, long = "dump-after")]
5858
pub dump_after: Vec<String>,
5959

60+
/// print out the IR after every pass
61+
#[argh(switch, long = "dump-all")]
62+
pub dump_all: bool,
63+
6064
/// print out assignments that falsify the constraints
6165
#[argh(switch, long = "show-models")]
6266
pub show_models: bool,
@@ -100,15 +104,17 @@ pub struct Opts {
100104
/// backend to use (default: verilog): calyx, verilog
101105
#[argh(option, long = "backend", default = "Backend::Verilog")]
102106
pub backend: Backend,
107+
103108
/// disable generation of counter-based FSMs in the backend.
104109
/// The default (non-counter) FSM is represented by a single bit Shift Register counting through the number of states.
105110
/// However, for components with a large number of states or a large II, it may be more efficient to use a counter-based FSM,
106111
/// where one counter loops every II states, at which point it increments the state counter.
107112
#[argh(switch, long = "no-counter-fsms")]
108113
pub no_counter_fsms: bool,
109-
/// preserves original port names during compilation.
110-
#[argh(switch, long = "preserve-names")]
111-
pub preserve_names: bool,
114+
115+
/// do not preserve original port names during compilation.
116+
#[argh(switch, long = "no-preserve-names")]
117+
pub no_preserve_names: bool,
112118

113119
// Solver specific configuration
114120
/// solver to use (default: cvc5): cvc5, z3

crates/filament/src/macros.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ macro_rules! ir_pass_pipeline {
6464
$(
6565
let name = <$pass as $crate::ir_visitor::Visitor>::name();
6666
$crate::log_time!(<$pass as $crate::ir_visitor::Visitor>::do_pass($opts, &mut $ir)?, name);
67-
if $opts.dump_after.contains(&name.to_string()) {
67+
if $opts.dump_after.contains(&name.to_string()) || $opts.dump_all {
68+
println!("=== After pass: {} ===", name);
6869
::fil_ir::Printer::context(& $ir, &mut std::io::stdout()).unwrap()
6970
}
7071
)*

crates/filament/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ fn run(opts: &cmdline::Opts) -> Result<(), u64> {
122122
return Ok(());
123123
}
124124
let calyx =
125-
log_time!(ip::Compile::compile(ir, opts.preserve_names), "compile");
125+
log_time!(ip::Compile::compile(ir, !opts.no_preserve_names), "compile");
126126
match opts.backend {
127127
cmdline::Backend::Verilog => {
128128
gen_verilog(calyx).unwrap();

0 commit comments

Comments
 (0)