Skip to content

Commit

Permalink
functional backend: rename get_input and get_current_state to input a…
Browse files Browse the repository at this point in the history
…nd current_state (more consistent with other methods)
  • Loading branch information
aiju committed Jul 25, 2024
1 parent 547b3e4 commit 4a860a0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions kernel/functionalir.cc
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ class FunctionalIRConstruction {
vector<Node> read_results;
factory.add_state(mem->cell->name, FunctionalIR::Sort(ceil_log2(mem->size), mem->width));
factory.set_initial_state(mem->cell->name, MemContents(mem));
Node node = factory.get_current_state(mem->cell->name);
Node node = factory.current_state(mem->cell->name);
for (size_t i = 0; i < mem->wr_ports.size(); i++) {
const auto &wr = mem->wr_ports[i];
if (wr.clk_enable)
Expand Down Expand Up @@ -543,7 +543,7 @@ class FunctionalIRConstruction {
log_error("The design contains a %s flip-flop at %s. This is not supported by the functional backend. "
"Call async2sync or clk2fflogic to avoid this error.\n", log_id(cell->type), log_id(cell));
factory.add_state(ff.name, FunctionalIR::Sort(ff.width));
Node q_value = factory.get_current_state(ff.name);
Node q_value = factory.current_state(ff.name);
factory.suggest_name(q_value, ff.name);
factory.update_pending(cell_outputs.at({cell, ID(Q)}), q_value);
factory.set_next_state(ff.name, enqueue(ff.sig_d));
Expand Down Expand Up @@ -593,7 +593,7 @@ class FunctionalIRConstruction {
DriveChunkWire wire_chunk = chunk.wire();
if (wire_chunk.is_whole()) {
if (wire_chunk.wire->port_input) {
Node node = factory.get_input(wire_chunk.wire->name);
Node node = factory.input(wire_chunk.wire->name);
factory.suggest_name(node, wire_chunk.wire->name);
factory.update_pending(pending, node);
} else {
Expand Down
4 changes: 2 additions & 2 deletions kernel/functionalir.h
Original file line number Diff line number Diff line change
Expand Up @@ -452,10 +452,10 @@ class FunctionalIR {
auto [it, inserted] = _ir._state_sorts.emplace(name, sort);
if (!inserted) log_error("state `%s` was re-defined", name.c_str());
}
Node get_input(IdString name) {
Node input(IdString name) {
return add(NodeData(Fn::input, name), Sort(_ir._input_sorts.at(name)), {});
}
Node get_current_state(IdString name) {
Node current_state(IdString name) {
return add(NodeData(Fn::state, name), Sort(_ir._state_sorts.at(name)), {});
}
void set_output(IdString output, Node value) {
Expand Down

0 comments on commit 4a860a0

Please sign in to comment.