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

feat: Handle ACIR calls in the debugger #5051

Merged
merged 37 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
14518f8
For disassembly view in DAP mode, return integer addresses
ggiraldez Apr 26, 2024
c0b713d
Fix unit tests
ggiraldez Apr 26, 2024
8e1427c
Update breakpoint set commands to handle new opcode addressing scheme
ggiraldez Apr 29, 2024
7f36701
Merge remote-tracking branch 'upstream/master' into fix/4904-dap-disa…
ggiraldez May 16, 2024
a03f83e
feat: Always output Brillig functions if forcing the runtime
ggiraldez May 13, 2024
ca767cf
chore: Re-enable debugger tests that should now pass
ggiraldez May 13, 2024
86afc2c
chore: Pass the whole CompiledProgram into the REPL debugger
ggiraldez May 14, 2024
d39c4fc
feat: Return a WitnessStack from the debugger
ggiraldez May 15, 2024
582dd6b
feat: The DebugContext now accepts a slice of circuits
ggiraldez May 15, 2024
f3f3b2b
feat: Support ACIR calls in the debugger
ggiraldez May 15, 2024
79ed5ac
feat: Introduce DebugLocation to consider circuit reference
ggiraldez May 16, 2024
2e4abb0
feat: Use DebugLocation and keep circuit ID on each exec frame
ggiraldez May 16, 2024
551827d
fix: Address mapping of opcodes now works for all circuits
ggiraldez May 16, 2024
d29e329
fix: Consider circuit when computing the source locations
ggiraldez May 17, 2024
4848fc8
feat: In the REPL, display opcodes for all circuits
ggiraldez May 17, 2024
f407a59
fix: Properly map address to debug location
ggiraldez May 17, 2024
57f4970
chore: Test address mapping with multiple circuits
ggiraldez May 17, 2024
19b1f89
Merge remote-tracking branch 'upstream/master' into feat/4824-multipl…
ggiraldez May 22, 2024
4d12d15
fix: Compilation errors
ggiraldez May 22, 2024
b28b07e
chore: cargo fmt
ggiraldez May 22, 2024
4bbf039
Fix merge conflicts from master
mverzilli May 29, 2024
aa37413
Merge branch 'master' into feat/4824-multiple-acir-calls
mverzilli May 30, 2024
79b7b91
Merge branch 'master' into feat/4824-multiple-acir-calls
mverzilli Jun 3, 2024
bf9461f
Re-enable some debugger integration tests
mverzilli Jun 3, 2024
4db5c9e
Merge branch 'noir-lang:master' into feat/4824-multiple-acir-calls
ggiraldez Jun 4, 2024
c46f253
Update tooling/debugger/src/repl.rs
mverzilli Jun 5, 2024
8779bfe
Merge branch 'master' into feat/4824-multiple-acir-calls
mverzilli Jun 13, 2024
8e99c6b
Fix compilation errors introduced in merge from master
mverzilli Jun 13, 2024
94b9d93
Merge branch 'master' into feat/4824-multiple-acir-calls
anaPerezGhiglia Jun 17, 2024
daacdac
Merge branch 'master' into feat/4824-multiple-acir-calls
anaPerezGhiglia Jun 18, 2024
e0e529b
Merge branch 'master' into feat/4824-multiple-acir-calls
anaPerezGhiglia Jun 21, 2024
7e882df
fix: PR comments (#3)
anaPerezGhiglia Jun 21, 2024
d45f8e7
Merge branch 'master' into feat/4824-multiple-acir-calls
anaPerezGhiglia Jun 28, 2024
d47f33c
Merge branch 'master' into feat/4824-multiple-acir-calls
anaPerezGhiglia Jun 28, 2024
d1ea77c
Recover lost change after merge
anaPerezGhiglia Jul 11, 2024
d373ba8
Merge branch 'master' into feat/4824-multiple-acir-calls
anaPerezGhiglia Jul 11, 2024
17eea72
Merge branch 'master' into feat/4824-multiple-acir-calls
anaPerezGhiglia Jul 11, 2024
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
19 changes: 13 additions & 6 deletions compiler/noirc_evaluator/src/ssa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,19 @@ pub fn create_program(
let recursive = program.recursive;
let ArtifactsAndWarnings((generated_acirs, generated_brillig, error_types), ssa_level_warnings) =
optimize_into_acir(program, options)?;
assert_eq!(
generated_acirs.len(),
func_sigs.len(),
"The generated ACIRs should match the supplied function signatures"
);

if options.force_brillig_output {
assert_eq!(
generated_acirs.len(),
1,
"Only the main ACIR is expected when forcing Brillig output"
);
} else {
assert_eq!(
generated_acirs.len(),
func_sigs.len(),
"The generated ACIRs should match the supplied function signatures"
);
}
let mut program_artifact = SsaProgramArtifact::new(generated_brillig, error_types);

// Add warnings collected at the Ssa stage
Expand Down
11 changes: 8 additions & 3 deletions compiler/noirc_evaluator/src/ssa/ssa_gen/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use acvm::{acir::AcirField, FieldElement};
use iter_extended::vecmap;
use noirc_errors::Location;
use noirc_frontend::ast::{BinaryOpKind, Signedness};
use noirc_frontend::monomorphization::ast::{self, LocalId, Parameters};
use noirc_frontend::monomorphization::ast::{self, InlineType, LocalId, Parameters};
use noirc_frontend::monomorphization::ast::{FuncId, Program};

use crate::errors::RuntimeError;
Expand Down Expand Up @@ -121,9 +121,14 @@ impl<'a> FunctionContext<'a> {
///
/// Note that the previous function cannot be resumed after calling this. Developers should
/// avoid calling new_function until the previous function is completely finished with ssa-gen.
pub(super) fn new_function(&mut self, id: IrFunctionId, func: &ast::Function) {
pub(super) fn new_function(
&mut self,
id: IrFunctionId,
func: &ast::Function,
force_brillig_runtime: bool,
) {
self.definitions.clear();
if func.unconstrained {
if func.unconstrained || (force_brillig_runtime && func.inline_type != InlineType::Inline) {
self.builder.new_brillig_function(func.name.clone(), id);
} else {
self.builder.new_function(func.name.clone(), id, func.inline_type);
Expand Down
2 changes: 1 addition & 1 deletion compiler/noirc_evaluator/src/ssa/ssa_gen/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ pub(crate) fn generate_ssa(
// to generate SSA for each function used within the program.
while let Some((src_function_id, dest_id)) = context.pop_next_function_in_queue() {
let function = &context.program[src_function_id];
function_context.new_function(dest_id, function);
function_context.new_function(dest_id, function, force_brillig_runtime);
function_context.codegen_function_body(&function.body)?;
}

Expand Down
2 changes: 1 addition & 1 deletion tooling/debugger/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ build-data.workspace = true
acvm.workspace = true
fm.workspace = true
nargo.workspace = true
noirc_frontend.workspace = true
noirc_frontend = { workspace = true, features = ["bn254"] }
noirc_printable_type.workspace = true
noirc_errors.workspace = true
noirc_driver.workspace = true
Expand Down
8 changes: 0 additions & 8 deletions tooling/debugger/ignored-tests.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
brillig_references
debug_logs
fold_after_inlined_calls
fold_basic
fold_basic_nested_call
fold_call_witness_condition
fold_complex_outputs
fold_distinct_return
fold_fibonacci
fold_numeric_generic_poseidon
is_unconstrained
macros
references
Expand Down
Loading
Loading