3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-27 02:45:52 +00:00

ast: add PRIORITY to $print cells

This commit is contained in:
Charlotte 2023-06-28 11:51:31 +10:00 committed by Marcelina Kościelnicka
parent 4ffdee65e0
commit f9d38253c5
4 changed files with 12 additions and 2 deletions

View file

@ -315,7 +315,10 @@ struct AST_INTERNAL::ProcessGenerator
// Buffer for generating the init action
RTLIL::SigSpec init_lvalue, init_rvalue;
ProcessGenerator(AstNode *always, RTLIL::SigSpec initSyncSignalsArg = RTLIL::SigSpec()) : always(always), initSyncSignals(initSyncSignalsArg)
// The most recently assigned $print cell \PRIORITY.
int last_print_priority;
ProcessGenerator(AstNode *always, RTLIL::SigSpec initSyncSignalsArg = RTLIL::SigSpec()) : always(always), initSyncSignals(initSyncSignalsArg), last_print_priority(0)
{
// rewrite lookahead references
LookaheadRewriter la_rewriter(always);
@ -716,6 +719,7 @@ struct AST_INTERNAL::ProcessGenerator
cell->parameters[ID::TRG_WIDTH] = triggers.size();
cell->parameters[ID::TRG_ENABLE] = !triggers.empty();
cell->parameters[ID::TRG_POLARITY] = polarity;
cell->parameters[ID::PRIORITY] = --last_print_priority;
cell->setPort(ID::TRG, triggers);
Wire *wire = current_module->addWire(sstr.str() + "_EN", 1);