Skip to content
Snippets Groups Projects
Commit 0f201541 authored by auphelia's avatar auphelia
Browse files

[Code Generation] Added function for config commands in code_gen dictionary

parent 915ec0d4
No related merge requests found
......@@ -129,10 +129,73 @@ def computation_cmds(model, code_gen_dict):
)
def config_cmds(model, code_gen_dict):
code_gen_dict["config"] = []
# TO DO: Find out values and add them to get_layer_parameters()
WPI = 1
WPF = 0
APF = 0
i = -1
for node in model.graph.node:
if node.op_type == "StreamingFCLayer_Batch":
i += 1
# get layer parameters
[
PE,
SIMD,
MH,
MW,
resDataType,
resType,
WMEM,
TMEM,
API,
] = get_layer_parameters(model, node)
code_gen_dict["config"].append(
"#define L{}_SIMD {} \n "
"#define L{}_PE {} \n "
"#define L{}_WMEM {} \n "
"#define L{}_TMEM {} \n "
"#define L{}_MW {} \n "
"#define L{}_MH {} \n "
"#define L{}_WPI {} \n "
"#define L{}_API {} \n "
"#define L{}_WPF {} \n "
"#define L{}_APF {} \n ".format(
i,
SIMD,
i,
PE,
i,
WMEM,
i,
TMEM,
i,
MW,
i,
MH,
i,
WPI,
i,
API,
i,
WPF,
i,
APF,
)
)
def code_generation(model):
code_gen_dict = {}
# config commands
config_cmds(model, code_gen_dict)
# stream declarations
strm_decl(model, code_gen_dict)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment