Skip to content

Commit

Permalink
more intricate signal info merging
Browse files Browse the repository at this point in the history
  • Loading branch information
ekiwi committed Dec 6, 2023
1 parent b8e06c5 commit 675cc26
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 9 additions & 4 deletions src/btor2/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -778,11 +778,16 @@ fn merge_signal_info(original: &SignalInfo, alias: &SignalInfo) -> SignalInfo {
// TODO: it might be interesting to retain alias names

// only overwrite the kind if it was a node, since other labels add more info
let kind = if original.kind == SignalKind::Node {
alias.kind
} else {
original.kind
let kind = match (original.kind, alias.kind) {
// nodes can always be renamed
(SignalKind::Node, alias) => alias,
// outputs always overwrite
(_, SignalKind::Output) => SignalKind::Output,
// otherwise we want to keep the original kind
(original, _) => original,
};
// TODO: it might be interesting to retain alias kinds
// e.g., a single signal could be a state and an output

SignalInfo { name, kind }
}
Expand Down
2 changes: 1 addition & 1 deletion src/sim/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ impl<'a> Simulator for Interpreter<'a> {

// copy init values from init to update program
for state in self.states.iter() {
println!("{}", state.symbol.get_symbol_name(self.ctx).unwrap());
// println!("{}", state.symbol.get_symbol_name(self.ctx).unwrap());
let src = self.init.get_range(&state.symbol).unwrap();
let dst = self.update.get_range(&state.symbol).unwrap();
exec::assign(&mut self.data[dst], &init_data[src]);
Expand Down

0 comments on commit 675cc26

Please sign in to comment.