Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linker bus support #2073

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use powdr::number::{
BabyBearField, BigUint, Bn254Field, FieldElement, GoldilocksField, KoalaBearField,
Mersenne31Field,
};
use powdr::pipeline::pipeline::LinkerMode;
use powdr::pipeline::test_runner;
use powdr::Pipeline;
use std::io;
Expand Down Expand Up @@ -154,6 +155,10 @@ enum Commands {
#[arg(long)]
backend_options: Option<String>,

/// Linker mode, deciding how to reduce links to constraints.
#[arg(long)]
linker_mode: Option<LinkerMode>,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
linker_mode: Option<LinkerMode>,
#[arg(value_parser = clap_enum_variants!(LinkerMode))]
linker_mode: Option<LinkerMode>,


/// Generate a CSV file containing the witness column values.
#[arg(long)]
#[arg(default_value_t = false)]
Expand Down Expand Up @@ -464,6 +469,7 @@ fn run_command(command: Commands) {
prove_with,
params,
backend_options,
linker_mode,
export_witness_csv,
export_all_columns_csv,
csv_mode,
Expand All @@ -478,6 +484,7 @@ fn run_command(command: Commands) {
prove_with,
params,
backend_options,
linker_mode,
export_witness_csv,
export_all_columns_csv,
csv_mode
Expand Down Expand Up @@ -668,14 +675,17 @@ fn run_pil<F: FieldElement>(
prove_with: Option<BackendType>,
params: Option<String>,
backend_options: Option<String>,
linker_mode: Option<LinkerMode>,
export_witness: bool,
export_all_columns: bool,
csv_mode: CsvRenderModeCLI,
) -> Result<(), Vec<String>> {
let inputs = split_inputs::<F>(&inputs);

let pipeline = bind_cli_args(
Pipeline::<F>::default().from_file(PathBuf::from(&file)),
Pipeline::<F>::default()
.from_file(PathBuf::from(&file))
.with_linker_mode(linker_mode.unwrap_or_default()),
inputs.clone(),
PathBuf::from(output_directory),
force,
Expand Down Expand Up @@ -804,6 +814,7 @@ mod test {
prove_with: Some(BackendType::EStarkDump),
params: None,
backend_options: Some("stark_gl".to_string()),
linker_mode: None,
export_witness_csv: false,
export_all_columns_csv: true,
csv_mode: CsvRenderModeCLI::Hex,
Expand Down
1 change: 1 addition & 0 deletions linker/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ powdr-analysis.workspace = true
powdr-ast.workspace = true
powdr-number.workspace = true
powdr-parser-util.workspace = true
strum = { version = "0.24.1", features = ["derive"] }

pretty_assertions = "1.4.0"
itertools = "0.13"
Expand Down
Loading