我需要转换这段代码:
bool hw = (gpio_ctrl(idx) >> 5) & 1;
uint8_t cnfg = (gpio_ctrl(idx) >> 3) & 3;
sc_dt::sc_logic oe_n = Log_1; // Default disable
sc_dt::sc_logic od = Log_Z; // Default disable
DEBUG_PRINTF(("GPIO update_ouput: CTRL=0x%x IDX=%d, HW=%d CNFG=%d, OE_N=%d, od=%d\n", gpio_ctrl(idx), idx, hw, cnfg, oe_n, od));
使用语义登录。
我尝试简单地这样做:
SEM_MSG(gpio_output_logic_update, SEM_INFO, "GPIO output logic update", "Control register index", ("value", SEM_ATTR_HEX), "HW (active low)", "Config style", "OE_N", "OD");
// ...
SEM_TRACE(gpio_output_logic_update, source, idx, gpio_ctrl(idx), hw, cnfg, oe_n, od);
但 SEM_MSG 并不神奇地理解 sc_logic。