Sdm_so_node_A.cpp #include <iostream> #include <unordered_map> #include <stdio.h> #include <stdlib.h> #include <signal.h> #include <unistd.h> #include <memory> #include <verilated_vcs_c.h> #include "VA_top.h" #include "sdm_config.h" #include "Sdm_node_A.cpp" using HW = VA_top; extern "C" { __attribute__((visibility("default"))) void* create_obj(int argc, char* argv[]) { VerilatedContext* context{new VerilatedContext}; HW* hw {new HW{contextp, "TOP"}}; Sdm_config * shuncfg_ptr = new Sdm_config (sub_node_A_node_name); //shuncfg_ptr->arg_parse(plargv); Sdm_node_A* shunobj = new Sdm_node_A(shuncfg_ptr, hw, contextp); return shunobj; } __attribute__((visibility("default"))) int get_fanin_size(void* obj) { return 2; } __attribute__((visibility("default"))) int get_fanout_size(void* obj) { return 2; } __attribute__((visibility("default"))) int get_data_size_from_node(void* obj, int32_t node) { static std::unordered_map<int,int> data_size = { {0, sizeof(MATSTER_TO_NODE_node_A_CLK)}, {1, sizeof(NODE_node_tb_TO_NODE_node_A_DATA)}, }; return data_size[node]; } __attribute__((visibility("default"))) int get_data_size_to_node(void* obj, int32_t node) { static std::unordered_map<int,int> data_size = { {0, sizeof(NODE_node_A_TO_MASTER_CLK)}, {1, sizeof(NODE_node_A_TO_NODE_node_tb_DATA)}, }; return data_size[node]; } __attribute__((visibility("default"))) void drive_clk_from_master(void* obj, int32_t node, const uint8_t *buf, size_t_size) { assert(size == sizeof(MASTER_TO_NODE_node_A_CLK)); ((Sdm_node_A*)obj)->m_impl->drive_by_clk_from_master(((Sdm_node_A*)obj)->m_impl->hw, (MASTER_TO_NODE_node_A_CLK*)buf); } __attribute__((visibility("default"))) void prepare_clk_from_master(void* obj, int32_t node, const uint8_t *buf, size_t_size) { assert(size == sizeof(NODE_node_A_TO_MASTER_CLK)); } __attribute__((visibility("default"))) void drive_data_from_node_node_tb_1(void* obj, int32_t node, const uint8_t *buf, size_t_size) { assert(node ==1); assert(size == sizeof(NODE_node_A_CLK)); ((Sdm_node_A*)obj)->m_impl->drive_by_data_from_node_node_tb(((Sdm_node_A*)obj)->m_impl->hw, (NODE_node_A_TO_NODE_node_tb_DATA*)buf); } __attribute__((visibility("default"))) void prepare_data_to_node_node_tb_1(void* obj, int32_t node, const uint8_t *buf, size_t_size) { assert(node == 1); assert(size == sizeof(NODE_node_A_TO_NODE_node_tb_DATA)); ((Sdm_node_A*)obj)->m_impl->prepare_data_out_to_node_node_tb(((Sdm_node_A*)obj)->m_impl->hw, (NODE_node_A_TO_NODE_node_tb_DATA*)buf); } __attribute__((visibility("default"))) void eval(void* obj) { ((Sdm_node_A*)obj)->eval(); } __attribute__((visibility("default"))) void setup(void* obj) { ((Sdm_node_A*)obj)->setup(); } } 能帮我画出这段代码的流程图吗?
时间: 2023-09-18 21:08:18 浏览: 151
当然可以帮你画出代码的流程图。以下是代码的流程图:
```
+------------------------+
| create_obj |
+------------------------+
|
v
+------------------------+
| get_fanin_size |
+------------------------+
|
v
+------------------------+
| get_fanout_size |
+------------------------+
|
v
+------------------------+
| get_data_size_from_node|
+------------------------+
|
v
+------------------------+
| get_data_size_to_node |
+------------------------+
|
v
+------------------------+
| drive_clk_from_master |
+------------------------+
|
v
+------------------------+
| prepare_clk_from_master|
+------------------------+
|
v
+------------------------+
|drive_data_from_node_node_tb_1|
+------------------------+
|
v
+------------------------+
|prepare_data_to_node_node_tb_1|
+------------------------+
|
v
+------------------------+
| eval |
+------------------------+
|
v
+------------------------+
| setup |
+------------------------+
```
希望这个流程图能够帮助你更好地理解代码的执行流程。如果你还有其他问题,请随时提问!
阅读全文