operator-keyword - 无法理解 systemc '<<' 操作
问题描述
我正在查看 systemc 库(特别是“示例”文件夹)中的“risc-cpu”代码,但我不明白 main.cpp 中的 << 操作是什么。在 main.cpp 他们实例化每个模块并使用许多 sc_signal 变量执行 << 操作。我认为这类似于绑定操作,但我想确切地知道。
下面是来自 main.cpp 的一些代码
fetch IFU("FETCH_BLOCK"); //instiate module fetch
IFU.init_param(delay_cycles); //module fetch delay for delay_cycles
IFU << ram_dataout << branch_target_address << next_pc << branch_valid
<< stall_fetch << intreq << vectno << bios_valid << icache_valid
<< pred_fetch << pred_branch_address << pred_branch_valid << ram_cs << ram_we
<< addr << ram_datain << instruction << instruction_valid << program_counter
<< intack_cpu << branch_clear << pred_fetch_valid << reset << clk;
decode IDU("DECODE_BLOCK"); //instanciate module decode as IDU
IDU << reset << instruction << pred_instruction << instruction_valid
<< pred_inst_valid << out_valid << destout << dout << dram_dataout
<< dram_rd_valid << destout << fdout << fout_valid << fdestout
<< branch_clear << dsp_data_valid << program_counter << pred_on
<< branch_instruction_address << next_pc << branch_valid
<< branch_target_address << mem_access << mem_address << alu_op
<< mem_write << alu_src << reg_write << src_A << src_B << forward_A
<< forward_B << stall_fetch << decode_valid << float_valid << mmx_valid
<< pid_valid << pid_data << clk;
解决方案
<<
是标准的左移运算符,它在 C++ 中被重载,也可用作放入流。在我看来,他们只是向IFU
and写入了很多值IDU
。
推荐阅读
- javascript - 输入 textarea 或 pre 时设置颜色格式
- excel - 如何计算多列中存在的项目的总和?
- sql - 查询写入最新更改的客户 ID
- python - 如何在fastapi中获取多个表单输入字段作为字典?
- python - 如何移动 JSON 中的日期以使日期相互冲突?
- python - 我如何除以列表 Y 中的变化?
- reactjs - 在反应中开发推送通知系统
- events - 谷歌日历 API。通过多个 extendProperty Private by Or 条件搜索事件
- javascript - 调用 toDataUrl() 时如何禁用 Fabric.js 中的图像平滑?
- angular - mat-tab-group - 将项目与中心、左右对齐