Skip to content

Commit

Permalink
TO-BE-TESTED: fix knobs access in mlp_int8
Browse files Browse the repository at this point in the history
  • Loading branch information
abnashkb committed Jul 31, 2024
1 parent f0eb1d1 commit c2154c9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions rad-sim/example-designs/mlp_int8/mlp_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ bool ParseWeights(std::vector<std::vector<int>>& weights,
std::vector<unsigned int>& layer_ids, std::vector<unsigned int>& mvm_ids,
unsigned int num_layers, std::vector<unsigned int>& num_mvms, unsigned int _rad_id) {

std::string design_root_dir = radsim_config.GetStringKnobShared("radsim_user_design_root_dir", _rad_id);
std::string design_root_dir = radsim_config.GetStringKnobPerRad("radsim_user_design_root_dir", _rad_id);
for (unsigned int l = 0; l < num_layers; l++) {
for (unsigned int m = 0; m < num_mvms[l]; m++) {
for (unsigned int d = 0; d < DPES; d++) {
Expand Down Expand Up @@ -44,7 +44,7 @@ bool ParseInstructions(std::vector<mvm_inst> &insts,
std::vector<unsigned int>& layer_ids,
std::vector<unsigned int>& mvm_ids,
unsigned int num_layers, std::vector<unsigned int>& num_mvms, unsigned int _rad_id) {
std::string design_root_dir = radsim_config.GetStringKnob("radsim_user_design_root_dir", _rad_id);
std::string design_root_dir = radsim_config.GetStringKnobPerRad("radsim_user_design_root_dir", _rad_id);

for (unsigned int l = 0; l < num_layers; l++) {
for (unsigned int m = 0; m < num_mvms[l]; m++) {
Expand Down
4 changes: 2 additions & 2 deletions rad-sim/example-designs/mlp_int8/mlp_top.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ mlp_top::mlp_top(const sc_module_name &name, RADSimDesignContext* radsim_design)
"layer" + std::to_string(layer_id) + "_mvm" + std::to_string(mvm_id);
std::strcpy(module_name, module_name_str.c_str());
sysc_matrix_vector_engines[layer_id][mvm_id] =
new sysc_mvm(module_name, mvm_id, layer_id);
new sysc_mvm(module_name, mvm_id, layer_id, radsim_design);
sysc_matrix_vector_engines[layer_id][mvm_id]->rst(rst);
}
for (unsigned int mvm_id = 0; mvm_id < num_mvms_rtl[layer_id]; mvm_id++) {
module_name_str =
"layer" + std::to_string(layer_id) + "_mvm" + std::to_string(mvm_id + num_mvms_sysc[layer_id]);
std::strcpy(module_name, module_name_str.c_str());
rtl_matrix_vector_engines[layer_id][mvm_id] =
new rtl_mvm(module_name);
new rtl_mvm(module_name, radsim_design);
rtl_matrix_vector_engines[layer_id][mvm_id]->rst(rst);
}
}
Expand Down
6 changes: 3 additions & 3 deletions rad-sim/example-designs/mlp_int8/modules/sysc_mvm.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "sysc_mvm.hpp"

sysc_mvm::sysc_mvm(const sc_module_name &name, unsigned int id_mvm, unsigned int id_layer)
: RADSimModule(name),
sysc_mvm::sysc_mvm(const sc_module_name &name, unsigned int id_mvm, unsigned int id_layer, RADSimDesignContext* radsim_design)
: RADSimModule(name, radsim_design),
rf_rdata("rf_rdata", DPES),
rf_wdata("rf_wdata"),
rf_wen("rf_wen", DPES),
Expand All @@ -27,7 +27,7 @@ sysc_mvm::sysc_mvm(const sc_module_name &name, unsigned int id_mvm, unsigned int
std::string datapath_name_str;
rf.resize(DPES);
datapath_inst.resize(DPES);
std::string mvm_dir = radsim_config.GetStringKnob("radsim_user_design_root_dir");
std::string mvm_dir = radsim_config.GetStringKnobPerRad("radsim_user_design_root_dir", radsim_design->rad_id);
std::string mem_init_file;

// STAGE 1: Instruction FIFO, Input FIFO, and Reduction FIFO
Expand Down
2 changes: 1 addition & 1 deletion rad-sim/example-designs/mlp_int8/modules/sysc_mvm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class sysc_mvm : public RADSimModule {
axis_slave_port rx_interface;
axis_master_port tx_interface;

sysc_mvm(const sc_module_name& name, unsigned int id_mvm, unsigned int id_layer);
sysc_mvm(const sc_module_name& name, unsigned int id_mvm, unsigned int id_layer, RADSimDesignContext* radsim_design);
~sysc_mvm();

void Assign();
Expand Down

0 comments on commit c2154c9

Please sign in to comment.