Skip to content
Merged
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
6 changes: 3 additions & 3 deletions conformance/sv-tests/expected.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ chapter-11/11.10.1--string_concat.sv fail
chapter-11/11.10.1--string_copy.sv fail
chapter-11/11.10.3--empty_string-sim.sv fail
chapter-11/11.10.3--empty_string.sv fail
chapter-11/11.11--min_max_avg_delay.sv fail
chapter-11/11.11--min_max_avg_delay.sv pass
chapter-11/11.12--let_construct.sv fail
chapter-11/11.3.5--expr_short_circuit.sv pass
chapter-11/11.3.6--assign_in_exp-sim.sv fail
Expand Down Expand Up @@ -726,7 +726,7 @@ chapter-9/9.3.5--statement_labels_par.sv fail
chapter-9/9.3.5--statement_labels_seq.sv pass
chapter-9/9.4.1--delay_control-sim.sv fail
chapter-9/9.4.1--delay_control-two-blocks-sim.sv fail
chapter-9/9.4.1--delay_control.sv fail
chapter-9/9.4.1--delay_control.sv pass
chapter-9/9.4.2--event_control_edge.sv fail
chapter-9/9.4.2--event_control_negedge.sv pass
chapter-9/9.4.2--event_control_posedge.sv pass
Expand All @@ -737,7 +737,7 @@ chapter-9/9.4.2.1--event_or_op.sv fail
chapter-9/9.4.2.2--event_implicit.sv pass
chapter-9/9.4.2.3--event_conditional.sv fail
chapter-9/9.4.2.4--event_sequence.sv fail
chapter-9/9.4.3--event_sequence_controls.sv fail
chapter-9/9.4.3--event_sequence_controls.sv pass
chapter-9/9.4.5--event_blocking_assignment_delay.sv fail
chapter-9/9.4.5--event_nonblocking_assignment_delay.sv fail
chapter-9/9.4.5--event_nonblocking_assignment_event.sv fail
Expand Down
35 changes: 23 additions & 12 deletions crates/celox-frontend-sv/src/lowering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use celox_design::{
BinaryOp, BitAccess, DisplaySizing, DomainKind, ExternFunction, ExternSignature, ExternType,
InitialStateData, InitialStateValue, ModuleId, PROCESS_DELAY_WIDTH, PROCESS_STATUS_WIDTH,
PortTypeKind, ProcessSlots, RegionedVarAddrBase, RuntimeErrorInfo, RuntimeEventKind,
RuntimeEventSite, STABLE_REGION, TriggerSet, UnaryOp, VarAtomBase, WORKING_REGION,
RuntimeEventSite, STABLE_REGION, TriggerSet, UnaryOp, VarAtomBase, WORKING_REGION, WaitSite,
};
use celox_frontend_core::process::PROCESS_RESUME_WIDTH;
use celox_frontend_core::symbolic::artifact::{
Expand Down Expand Up @@ -1977,7 +1977,7 @@ fn lower_module_with_overrides(
)
};
mark_ff_event_domains(&event_vars, &mut variables);
let (initial_values, processes) = lower_initial_processes(
let (initial_values, processes, wait_sites) = lower_initial_processes(
module,
&mut variables,
&mut name_to_id,
Expand Down Expand Up @@ -2082,7 +2082,7 @@ fn lower_module_with_overrides(
processes,
package_bindings: HashMap::default(),
counter_slots: Vec::new(),
wait_sites: Vec::new(),
wait_sites,
nba_sites: Vec::new(),
},
variables,
Expand Down Expand Up @@ -2740,9 +2740,16 @@ fn lower_initial_processes(
runtime_event_sites: &mut Vec<RuntimeEventSite>,
runtime_errors: &mut HashMap<i64, RuntimeErrorInfo<SourceVarId>>,
extern_functions: &mut Vec<ExternFunction>,
) -> Result<(Vec<InitialStateValue<SourceVarId>>, Vec<SymbolicProcess>), sv::AnalyzerError> {
) -> Result<
(
Vec<InitialStateValue<SourceVarId>>,
Vec<SymbolicProcess>,
Vec<WaitSite<SourceVarId>>,
),
sv::AnalyzerError,
> {
if module.initial_processes().is_empty() {
return Ok((Vec::new(), Vec::new()));
return Ok((Vec::new(), Vec::new(), Vec::new()));
}
let mut values = Vec::new();
let mut runtime = Vec::new();
Expand Down Expand Up @@ -2790,7 +2797,7 @@ fn lower_initial_processes(
}
}
if runtime.is_empty() {
return Ok((values, Vec::new()));
return Ok((values, Vec::new(), Vec::new()));
}

let mut next_id = SourceVarId(
Expand Down Expand Up @@ -2844,21 +2851,25 @@ fn lower_initial_processes(
pm.runtime_event_sites = std::mem::take(runtime_event_sites);
pm.runtime_errors = std::mem::take(runtime_errors);
pm.extern_functions = std::mem::take(extern_functions);
let mut wait_sites = Vec::new();
let processes = runtime
.into_iter()
.zip(slots)
.map(|((process, random_seed), slots)| {
Ok(SymbolicProcess {
kernel: ff::Ff::new(&mut pm, random_seed)
.lower_initial_kernel(process.body(), slots)?,
.enumerate()
.map(|(index, ((process, random_seed), slots))| {
let (kernel, sites) = ff::Ff::new(&mut pm, random_seed).lower_initial_kernel(
process.body(),
slots,
})
index,
)?;
wait_sites.extend(sites);
Ok(SymbolicProcess { kernel, slots })
})
.collect::<Result<Vec<_>, sv::AnalyzerError>>();
*runtime_event_sites = std::mem::take(&mut pm.runtime_event_sites);
*runtime_errors = std::mem::take(&mut pm.runtime_errors);
*extern_functions = std::mem::take(&mut pm.extern_functions);
Ok((values, processes?))
Ok((values, processes?, wait_sites))
}

fn lower_comb_processes(
Expand Down
4 changes: 4 additions & 0 deletions crates/celox-frontend-sv/src/lowering/comb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1788,6 +1788,10 @@ impl<'p, 'a> Comb<'p, 'a> {
self.assign_concat(&mut store, frames, parts, rhs)?;
Ok(store)
}
// A timing control suspends a process; this lowering has none.
sv::ir::Stmt::Delay(_) | sv::ir::Stmt::WaitEvent(_) | sv::ir::Stmt::Wait(_) => {
Err(unsupported("procedural timing control"))
}
sv::ir::Stmt::Local { name, init } => {
let id = self
.m
Expand Down
Loading
Loading