扩充内置功能块为 8 个:TON/TOF/TP/CTU/CTD/CTUD/R_TRIG/F_TRIG。
- isa:CAL_* 操作码连续占 24..31(CALL/RET 后移为 32/33,kOpCount=34);disasm 支持 5 个新操作码 - 词法/语法/链接:新 8 个关键字与冻结布局(TP=in/pt/q/et、CTD=cd/ld/pv/q/cv、 CTUD=cu/cd/r/lu/pv/qu/qd/cv、R_TRIG/F_TRIG=clk/q) - VM:do_cal 全 8 个语义(TP 脉冲、CTD 递减、CTUD 双向+装载、R_TRIG 上升沿、F_TRIG 下降沿); edge_prev_ 每槽 2 字节存边沿上次输入;exec_one 分发补 5 个新操作码 - 验证:TP 30ms 脉冲 2 周期、CTD 装载+递减到 q=1、CTUD cu/cd 双向、R/F_TRIG 交替; ctest 11/11 全绿 - 文档:指令与映像/词法/初步计划/符号表与链接/指令执行/扫描周期/使用说明 同步
This commit is contained in:
@@ -327,10 +327,18 @@ namespace {
|
||||
f.code.push_back(isa::enc_slot(isa::Op::STORE_GLOBAL, t, it->second));
|
||||
}
|
||||
if (inst->type_name == "ton" || inst->type_name == "tof" ||
|
||||
inst->type_name == "ctu") {
|
||||
const isa::Op op = inst->type_name == "ton" ? isa::Op::CAL_TON
|
||||
: inst->type_name == "tof" ? isa::Op::CAL_TOF
|
||||
: isa::Op::CAL_CTU;
|
||||
inst->type_name == "tp" || inst->type_name == "ctu" ||
|
||||
inst->type_name == "ctd" || inst->type_name == "ctud" ||
|
||||
inst->type_name == "r_trig" || inst->type_name == "f_trig") {
|
||||
const isa::Op op =
|
||||
inst->type_name == "ton" ? isa::Op::CAL_TON
|
||||
: inst->type_name == "tof" ? isa::Op::CAL_TOF
|
||||
: inst->type_name == "tp" ? isa::Op::CAL_TP
|
||||
: inst->type_name == "ctu" ? isa::Op::CAL_CTU
|
||||
: inst->type_name == "ctd" ? isa::Op::CAL_CTD
|
||||
: inst->type_name == "ctud" ? isa::Op::CAL_CTUD
|
||||
: inst->type_name == "r_trig" ? isa::Op::CAL_R_TRIG
|
||||
: isa::Op::CAL_F_TRIG;
|
||||
f.code.push_back(isa::enc_slot(op, 0, inst->base));
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user