Skip to content

Commit 0bbd49b

Browse files
Merge pull request #31 from ErickOF/jvillalobos/TLM_FIXES
Add compilation flags to avoid debug prints
2 parents 5e019e5 + 1c1bd3f commit 0bbd49b

13 files changed

+252
-141
lines changed

modules/router/Makefile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,36 @@ ifdef IPS_JPG_PV_EN
6767
LFLAGS += -DIPS_JPG_PV_EN
6868
endif # IPS_JPG_PV_EN
6969

70+
ifdef DISABLE_ROUTER_DEBUG
71+
CFLAGS += -DDISABLE_ROUTER_DEBUG
72+
LFLAGS += -DDISABLE_ROUTER_DEBUG
73+
endif # DISABLE_ROUTER_DEBUG
74+
75+
ifdef DISABLE_FILTER_DEBUG
76+
CFLAGS += -DDISABLE_FILTER_DEBUG
77+
LFLAGS += -DDISABLE_FILTER_DEBUG
78+
endif # DISABLE_FILTER_DEBUG
79+
80+
ifdef DISABLE_MEM_DEBUG
81+
CFLAGS += -DDISABLE_MEM_DEBUG
82+
LFLAGS += -DDISABLE_MEM_DEBUG
83+
endif # DISABLE_MEM_DEBUG
84+
85+
ifdef DISABLE_RGB_DEBUG
86+
CFLAGS += -DDISABLE_RGB_DEBUG
87+
LFLAGS += -DDISABLE_RGB_DEBUG
88+
endif # DISABLE_RGB_DEBUG
89+
90+
ifdef DISABLE_SOBEL_DEBUG
91+
CFLAGS += -DDISABLE_SOBEL_DEBUG
92+
LFLAGS += -DDISABLE_SOBEL_DEBUG
93+
endif # DISABLE_SOBEL_DEBUG
94+
95+
ifdef DISABLE_TB_DEBUG
96+
CFLAGS += -DDISABLE_TB_DEBUG
97+
LFLAGS += -DDISABLE_TB_DEBUG
98+
endif # DISABLE_TB_DEBUG
99+
70100
.PHONY: print-all
71101
print-all:
72102
@echo "Incdir is $(INCDIR)"

modules/router/include/common_func.hpp

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,32 @@
22
#define COMMON_FUNC_HPP
33

44
#define dbgprint(FORMAT, ARGS...) \
5-
printf("%s(%0d) @%s: " FORMAT "\n", __FILE__, __LINE__, sc_time_stamp().to_string().c_str(), ##ARGS)
5+
printf("%s(%0d) @%s: " FORMAT "\n", __FILE__, __LINE__, sc_time_stamp().to_string().c_str(), ##ARGS);
66

7-
#define dbgmodprint(FORMAT, ARGS...) \
8-
printf("%s(%0d) [%s] @%s : " FORMAT "\n", __FILE__, __LINE__, this->name(), sc_time_stamp().to_string().c_str(), ##ARGS)
7+
#define dbgmodprint(DBG_ACT, FORMAT, ARGS...) \
8+
if (DBG_ACT) printf("%s(%0d) [%s] @%s : " FORMAT "\n", __FILE__, __LINE__, this->name(), sc_time_stamp().to_string().c_str(), ##ARGS)
99

10-
#define dbgimgtarmodprint(FORMAT, ARGS...) \
11-
printf("%s(%0d) [%s] @%s : " FORMAT "\n", __FILE__, __LINE__, img_target::name(), sc_time_stamp().to_string().c_str(), ##ARGS)
10+
#define dbgimgtarmodprint(DBG_ACT, FORMAT, ARGS...) \
11+
if (DBG_ACT) printf("%s(%0d) [%s] @%s : " FORMAT "\n", __FILE__, __LINE__, img_target::name(), sc_time_stamp().to_string().c_str(), ##ARGS)
12+
13+
#define checkprintenable(DBG_ACT) \
14+
if (DBG_ACT) \
15+
{ \
16+
printf("%s(%0d) [%s] @%s : " "Prints enabled for this module" "\n", __FILE__, __LINE__, this->name(), sc_time_stamp().to_string().c_str()); \
17+
} \
18+
else \
19+
{ \
20+
printf("%s(%0d) [%s] @%s : " "Prints are not enabled for this module" "\n", __FILE__, __LINE__, this->name(), sc_time_stamp().to_string().c_str()); \
21+
}
22+
23+
#define checkprintenableimgtar(DBG_ACT) \
24+
if (DBG_ACT) \
25+
{ \
26+
printf("%s(%0d) [%s] @%s : " "Prints enabled for this module" "\n", __FILE__, __LINE__, img_target::name(), sc_time_stamp().to_string().c_str()); \
27+
} \
28+
else \
29+
{ \
30+
printf("%s(%0d) [%s] @%s : " "Prints are not enabled for this module" "\n", __FILE__, __LINE__, img_target::name(), sc_time_stamp().to_string().c_str()); \
31+
}
1232

1333
#endif // COMMON_FUNC_HPP

modules/router/include/ips_filter_tlm.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ using namespace std;
1919
struct ips_filter_tlm : public Filter<IPS_IN_TYPE_TB, IPS_OUT_TYPE_TB, IPS_FILTER_KERNEL_SIZE>, public img_target
2020
{
2121

22-
SC_CTOR(ips_filter_tlm): Filter<IPS_IN_TYPE_TB, IPS_OUT_TYPE_TB, IPS_FILTER_KERNEL_SIZE>(Filter<IPS_IN_TYPE_TB, IPS_OUT_TYPE_TB, IPS_FILTER_KERNEL_SIZE>::name()), img_target(img_target::name()) {
22+
ips_filter_tlm(sc_module_name name) : Filter<IPS_IN_TYPE_TB, IPS_OUT_TYPE_TB, IPS_FILTER_KERNEL_SIZE>((std::string(name) + "_HW_block").c_str()), img_target((std::string(name) + "_target").c_str()) {
23+
#ifdef DISABLE_FILTER_DEBUG
24+
this->use_prints = false;
25+
#endif //DISABLE_FILTER_DEBUG
26+
checkprintenableimgtar(use_prints);
2327
}
2428

2529
//Override do_when_transaction functions

modules/router/include/memory_tlm.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,12 @@ using namespace std;
1616
struct memory_tlm : public img_target
1717
{
1818

19-
SC_CTOR(memory_tlm): img_target(img_target::name()) {
19+
memory_tlm(sc_module_name name) : img_target((std::string(name) + "_target").c_str()) {
2020
mem_array = new unsigned char[2764852];
21+
#ifdef DISABLE_MEM_DEBUG
22+
this->use_prints = false;
23+
#endif //DISABLE_MEM_DEBUG
24+
checkprintenableimgtar(use_prints);
2125
}
2226

2327
//Override do_when_transaction functions

modules/router/include/rgb2gray_tlm.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ using namespace std;
1717
struct rgb2gray_tlm : public Rgb2Gray, public img_target
1818
{
1919

20-
SC_CTOR(rgb2gray_tlm): Rgb2Gray(Rgb2Gray::name()), img_target(img_target::name()) {
20+
rgb2gray_tlm(sc_module_name name) : Rgb2Gray((std::string(name) + "_HW_block").c_str()), img_target((std::string(name) + "_target").c_str()) {
21+
#ifdef DISABLE_RGB_DEBUG
22+
this->use_prints = false;
23+
#endif //DISABLE_RGB_DEBUG
24+
checkprintenableimgtar(use_prints);
2125
}
2226

2327
//Override do_when_transaction functions

modules/router/include/sobel_edge_detector_tlm.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ using namespace std;
1717
struct sobel_edge_detector_tlm : public Edge_Detector, public img_target
1818
{
1919

20-
SC_CTOR(sobel_edge_detector_tlm): Edge_Detector(Edge_Detector::name()), img_target(img_target::name()) {
20+
sobel_edge_detector_tlm(sc_module_name name) : Edge_Detector((std::string(name) + "_HW_block").c_str()), img_target((std::string(name) + "_target").c_str()) {
21+
#ifdef DISABLE_SOBEL_DEBUG
22+
this->use_prints = false;
23+
#endif //DISABLE_SOBEL_DEBUG
24+
checkprintenableimgtar(use_prints);
2125
}
2226

2327
//Override do_when_transaction functions

modules/router/run_all.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@ case $1 in
44
"save_log")
55
make INCLUDE_OPENCV_PKG=1 RGB2GRAY_PV_EN=1 IPS_FILTER_LT_EN=1 EDGE_DETECTOR_AT_EN=1 IMG_UNIFICATE_PV_EN=1 IPS_JPG_PV_EN=1 USING_TLM_TB_EN=1 all > output.log
66
;;
7+
"save_log_no_dbg")
8+
make INCLUDE_OPENCV_PKG=1 RGB2GRAY_PV_EN=1 IPS_FILTER_LT_EN=1 EDGE_DETECTOR_AT_EN=1 IMG_UNIFICATE_PV_EN=1 IPS_JPG_PV_EN=1 USING_TLM_TB_EN=1 DISABLE_ROUTER_DEBUG=1 DISABLE_FILTER_DEBUG=1 DISABLE_MEM_DEBUG=1 DISABLE_RGB_DEBUG=1 DISABLE_SOBEL_DEBUG=1 DISABLE_TB_DEBUG=1 all > output.log
9+
;;
710
"print_all")
811
make INCLUDE_OPENCV_PKG=1 RGB2GRAY_PV_EN=1 IPS_FILTER_LT_EN=1 EDGE_DETECTOR_AT_EN=1 IMG_UNIFICATE_PV_EN=1 IPS_JPG_PV_EN=1 USING_TLM_TB_EN=1 print-all
912
;;
1013
"compile")
11-
make INCLUDE_OPENCV_PKG=1 RGB2GRAY_PV_EN=1 IPS_FILTER_LT_EN=1 EDGE_DETECTOR_AT_EN=1 IMG_UNIFICATE_PV_EN=1 IPS_JPG_PV_EN=1 USING_TLM_TB_EN=1 compile
14+
make INCLUDE_OPENCV_PKG=1 RGB2GRAY_PV_EN=1 IPS_FILTER_LT_EN=1 EDGE_DETECTOR_AT_EN=1 IMG_UNIFICATE_PV_EN=1 IPS_JPG_PV_EN=1 USING_TLM_TB_EN=1 DISABLE_ROUTER_DEBUG=1 DISABLE_FILTER_DEBUG=1 DISABLE_MEM_DEBUG=1 DISABLE_RGB_DEBUG=1 DISABLE_SOBEL_DEBUG=1 DISABLE_TB_DEBUG=1 compile
1215
;;
1316
"router_tb")
1417
make INCLUDE_OPENCV_PKG=1 RGB2GRAY_PV_EN=1 EDGE_DETECTOR_AT_EN=1 USING_TLM_ROUTER_TB_EN=1 USING_TLM_TB_EN=1 all > output.log
@@ -17,6 +20,6 @@ case $1 in
1720
make INCLUDE_OPENCV_PKG=1 RGB2GRAY_PV_EN=1 EDGE_DETECTOR_AT_EN=1 USING_TLM_ROUTER_TB_EN=1 USING_TLM_TB_EN=1 all > output.log
1821
;;
1922
*)
20-
make INCLUDE_OPENCV_PKG=1 RGB2GRAY_PV_EN=1 IPS_FILTER_LT_EN=1 EDGE_DETECTOR_AT_EN=1 IMG_UNIFICATE_PV_EN=1 IPS_JPG_PV_EN=1 USING_TLM_TB_EN=1 all
23+
make INCLUDE_OPENCV_PKG=1 RGB2GRAY_PV_EN=1 IPS_FILTER_LT_EN=1 EDGE_DETECTOR_AT_EN=1 IMG_UNIFICATE_PV_EN=1 IPS_JPG_PV_EN=1 USING_TLM_TB_EN=1 DISABLE_ROUTER_DEBUG=1 DISABLE_FILTER_DEBUG=1 DISABLE_MEM_DEBUG=1 DISABLE_RGB_DEBUG=1 DISABLE_SOBEL_DEBUG=1 DISABLE_TB_DEBUG=1 all
2124
;;
2225
esac

modules/router/src/img_initiator.cpp

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,12 @@ struct img_initiator: sc_module
4747
// DEBUG
4848
unsigned int transaction_sent_id = 0;
4949
unsigned int transaction_received_id = 0;
50+
51+
bool use_prints;
5052

5153
//Constructor
5254
SC_CTOR(img_initiator)
53-
: socket("socket"), m_peq(this, &img_initiator::peq_cb) // Construct and name socket
55+
: socket("socket"), m_peq(this, &img_initiator::peq_cb), use_prints(true) // Construct and name socket
5456
{
5557
// Register callbacks for incoming interface method calls
5658
socket.register_nb_transport_bw(this, &img_initiator::nb_transport_bw);
@@ -81,11 +83,10 @@ struct img_initiator: sc_module
8183

8284
data = transaction->get_data_ptr();
8385
//-----------DEBUG-----------
84-
dbgmodprint("Reading at Initiator: ");
86+
dbgmodprint(use_prints, "Reading at Initiator: ");
8587
for (long unsigned int i = 0; i < transaction->get_data_length()/sizeof(int); ++i){
86-
dbgmodprint("%02x", *(reinterpret_cast<int*>(transaction->get_data_ptr())+i));
88+
dbgmodprint(use_prints, "%02x", *(reinterpret_cast<int*>(transaction->get_data_ptr())+i));
8789
}
88-
printf("\n");
8990
//-----------DEBUG-----------
9091
}
9192

@@ -108,11 +109,10 @@ struct img_initiator: sc_module
108109
transaction->set_extension(img_ext);
109110

110111
//-----------DEBUG-----------
111-
dbgmodprint("Writing: ");
112+
dbgmodprint(use_prints, "Writing: ");
112113
for (long unsigned int i = 0; i < data_length/sizeof(int); ++i){
113-
dbgmodprint("%02x", *(reinterpret_cast<int*>(transaction->get_data_ptr())+i));
114+
dbgmodprint(use_prints, "%02x", *(reinterpret_cast<int*>(transaction->get_data_ptr())+i));
114115
}
115-
printf("\n");
116116
//-----------DEBUG-----------
117117

118118
//Set transaction
@@ -134,14 +134,14 @@ struct img_initiator: sc_module
134134

135135
this->transaction_sent_id = img_ext->transaction_number;
136136

137-
dbgmodprint("BEGIN_REQ SENT TRANS ID %0d", img_ext->transaction_number);
137+
dbgmodprint(use_prints, "BEGIN_REQ SENT TRANS ID %0d", img_ext->transaction_number);
138138
status = socket->nb_transport_fw(*transaction, phase, ((cur_command == tlm::TLM_WRITE_COMMAND) ? this->write_delay : this->read_delay)); // Non-blocking transport call
139139

140140
// Check request status returned by target
141141
switch (status) {
142142
//Case 1: Transaction was accepted
143143
case tlm::TLM_ACCEPTED: {
144-
dbgmodprint("%s received -> Transaction ID %d", "TLM_ACCEPTED", img_ext->transaction_number);
144+
dbgmodprint(use_prints, "%s received -> Transaction ID %d", "TLM_ACCEPTED", img_ext->transaction_number);
145145
check_transaction(*transaction);
146146
//transaction->release();
147147
//Initiator only cares about sending the transaction, doesnt need to wait for response (non-blocking)
@@ -150,7 +150,7 @@ struct img_initiator: sc_module
150150

151151
//Not implementing Updated and Completed Status
152152
default: {
153-
dbgmodprint("[ERROR] Invalid status received at initiator -> Transaction ID %d", img_ext->transaction_number);
153+
dbgmodprint(use_prints, "[ERROR] Invalid status received at initiator -> Transaction ID %d", img_ext->transaction_number);
154154
break;
155155
}
156156
}
@@ -161,11 +161,10 @@ struct img_initiator: sc_module
161161
this->transaction_received_id = img_ext->transaction_number;
162162
// }
163163
//-----------DEBUG-----------
164-
dbgmodprint("[DEBUG1] Reading at Initiator: ");
164+
dbgmodprint(use_prints, "[DEBUG1] Reading at Initiator: ");
165165
for (long unsigned int i = 0; i < transaction->get_data_length()/sizeof(int); ++i){
166-
dbgmodprint("%02x", *(reinterpret_cast<int*>(transaction->get_data_ptr())+i));
166+
dbgmodprint(use_prints, "%02x", *(reinterpret_cast<int*>(transaction->get_data_ptr())+i));
167167
}
168-
printf("\n");
169168
//-----------DEBUG-----------
170169

171170
//Increment transaction ID
@@ -185,7 +184,7 @@ struct img_initiator: sc_module
185184
void peq_cb(tlm::tlm_generic_payload& trans, const tlm::tlm_phase& phase)
186185
{
187186

188-
//dbgmodprint("%s received -> Transaction ID %d from address %x", phase, this->id_extension->transaction_id);
187+
//dbgmodprint(use_prints, "%s received -> Transaction ID %d from address %x", phase, this->id_extension->transaction_id);
189188
//cout << name() << " " <<hex << trans.get_address() << " BEGIN_RESP RECEIVED at " << sc_time_stamp() << endl;
190189
switch (phase) {
191190
case tlm::BEGIN_RESP: {
@@ -195,20 +194,18 @@ struct img_initiator: sc_module
195194
//Initiator dont care about confirming resp transaction. So nothing else to do.
196195

197196
//-----------DEBUG-----------
198-
dbgmodprint("[DEBUG] Reading at Initiator: ");
197+
dbgmodprint(use_prints, "[DEBUG] Reading at Initiator: ");
199198
for (long unsigned int i = 0; i < trans.get_data_length()/sizeof(int); ++i){
200-
dbgmodprint("%02x", *(reinterpret_cast<int*>(trans.get_data_ptr())+i));
199+
dbgmodprint(use_prints, "%02x", *(reinterpret_cast<int*>(trans.get_data_ptr())+i));
201200
}
202-
printf("\n");
203201
//-----------DEBUG-----------
204202

205203
transaction_received_e.notify();
206204
//-----------DEBUG-----------
207-
dbgmodprint("[DEBUG] Reading at Initiator: ");
205+
dbgmodprint(use_prints, "[DEBUG] Reading at Initiator: ");
208206
for (long unsigned int i = 0; i < trans.get_data_length()/sizeof(int); ++i){
209-
dbgmodprint("%02x", *(reinterpret_cast<int*>(trans.get_data_ptr())+i));
207+
dbgmodprint(use_prints, "%02x", *(reinterpret_cast<int*>(trans.get_data_ptr())+i));
210208
}
211-
printf("\n");
212209
//-----------DEBUG-----------
213210
break;
214211
}

modules/router/src/img_router.cpp

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,12 @@ struct img_router: sc_module
7777
//DEBUG
7878
unsigned int transaction_in_fw_path_id = 0;
7979
unsigned int transaction_in_bw_path_id = 0;
80+
81+
bool use_prints;
8082

8183
//Constructor
8284
SC_CTOR(img_router)
83-
: target_socket("socket"), bw_m_peq(this, &img_router::bw_peq_cb), fw_m_peq(this, &img_router::fw_peq_cb), fw_fifo(10), bw_fifo(2) // Construct and name socket
85+
: target_socket("socket"), bw_m_peq(this, &img_router::bw_peq_cb), fw_m_peq(this, &img_router::fw_peq_cb), fw_fifo(10), bw_fifo(2), use_prints(true) // Construct and name socket
8486
{
8587
// Register callbacks for incoming interface method calls
8688
target_socket.register_nb_transport_fw(this, &img_router::nb_transport_fw);
@@ -93,6 +95,11 @@ struct img_router: sc_module
9395

9496
SC_THREAD(fw_thread);
9597
SC_THREAD(bw_thread);
98+
99+
#ifdef DISABLE_ROUTER_DEBUG
100+
this->use_prints = false;
101+
#endif //DISABLE_ROUTER_DEBUG
102+
checkprintenable(use_prints);
96103
}
97104

98105
//Address Decoding
@@ -106,25 +113,25 @@ struct img_router: sc_module
106113
switch(address) {
107114
// To Filter
108115
case IMG_FILTER_KERNEL: {
109-
dbgmodprint("Decoded address %016llX corresponds to Filter module.", address);
116+
dbgmodprint(use_prints, "Decoded address %016llX corresponds to Filter module.", address);
110117
return IMG_FILTER_INITIATOR_ID;
111118
}
112119

113120
// To/from Sobel
114121
case SOBEL_INPUT_0:
115122
case SOBEL_INPUT_1:
116123
case SOBEL_OUTPUT: {
117-
dbgmodprint("Decoded address %016llX corresponds to Sobel module.", address);
124+
dbgmodprint(use_prints, "Decoded address %016llX corresponds to Sobel module.", address);
118125
return IMG_SOBEL_INITIATOR_ID;
119126
}
120127

121128
// To/From Memory Valid addresses
122129
case MEM_START ... MEM_FINISH : {
123-
dbgmodprint("Decoded address %016llX corresponds to Memory.", address);
130+
dbgmodprint(use_prints, "Decoded address %016llX corresponds to Memory.", address);
124131
return IMG_MEMORY_INITIATOR_ID;
125132
}
126133
default: {
127-
dbgmodprint("[ERROR] Decoding invalid address %016llX.", address);
134+
dbgmodprint(use_prints, "[ERROR] Decoding invalid address %016llX.", address);
128135
SC_REPORT_FATAL("[IMG ROUTER]", "Received address is invalid, does not match any hardware block");
129136
return INVALID_INITIATOR_ID;
130137
}
@@ -144,12 +151,12 @@ struct img_router: sc_module
144151
item.delay = delay;
145152
trans.get_extension(img_ext);
146153
if (bw_fifo.num_free() == 0) {
147-
dbgmodprint("[BW_FIFO] FIFO is FULL. Waiting...");
154+
dbgmodprint(use_prints, "[BW_FIFO] FIFO is FULL. Waiting...");
148155
wait(bw_fifo.data_read_event());
149156
}
150157
bw_fifo.nb_write(item);
151158
wait(bw_fifo.data_written_event());
152-
dbgmodprint("[BW_FIFO] Pushed transaction #%0d", img_ext->transaction_number);
159+
dbgmodprint(use_prints, "[BW_FIFO] Pushed transaction #%0d", img_ext->transaction_number);
153160
return tlm::TLM_ACCEPTED;
154161
}
155162

@@ -166,12 +173,12 @@ struct img_router: sc_module
166173
item.delay = delay;
167174
trans.get_extension(img_ext);
168175
if (fw_fifo.num_free() == 0) {
169-
dbgmodprint("[FW_FIFO] FIFO is FULL. Waiting...");
176+
dbgmodprint(use_prints, "[FW_FIFO] FIFO is FULL. Waiting...");
170177
wait(fw_fifo.data_read_event());
171178
}
172179
fw_fifo.nb_write(item);
173180
wait(fw_fifo.data_written_event());
174-
dbgmodprint("[FW_FIFO] Pushed transaction #%0d", img_ext->transaction_number);
181+
dbgmodprint(use_prints, "[FW_FIFO] Pushed transaction #%0d", img_ext->transaction_number);
175182
return tlm::TLM_ACCEPTED;
176183
}
177184

@@ -192,7 +199,7 @@ struct img_router: sc_module
192199
phase = item.phase;
193200
delay = item.delay;
194201
(*trans_ptr).get_extension(img_ext);
195-
dbgmodprint("[FW_FIFO] Popped transaction #%0d", img_ext->transaction_number);
202+
dbgmodprint(use_prints, "[FW_FIFO] Popped transaction #%0d", img_ext->transaction_number);
196203
fw_m_peq.notify(*trans_ptr, phase, delay);
197204
wait(fw_delay);
198205
}
@@ -215,7 +222,7 @@ struct img_router: sc_module
215222
phase = item.phase;
216223
delay = item.delay;
217224
(*trans_ptr).get_extension(img_ext);
218-
dbgmodprint("[BW_FIFO] Popped transaction #%0d", img_ext->transaction_number);
225+
dbgmodprint(use_prints, "[BW_FIFO] Popped transaction #%0d", img_ext->transaction_number);
219226
bw_m_peq.notify(*trans_ptr, phase, delay);
220227
wait(bw_delay);
221228
}
@@ -231,7 +238,7 @@ struct img_router: sc_module
231238
sc_dt::uint64 address = trans.get_address();
232239
this->transaction_in_bw_path_id = img_ext->transaction_number;
233240

234-
dbgmodprint("Received transaction #%0d with address %016llX in backward path. Redirecting transaction to CPU", img_ext->transaction_number, address);
241+
dbgmodprint(use_prints, "Received transaction #%0d with address %016llX in backward path. Redirecting transaction to CPU", img_ext->transaction_number, address);
235242
target_socket->nb_transport_bw(trans, local_phase, this->bw_delay);
236243
}
237244

@@ -245,7 +252,7 @@ struct img_router: sc_module
245252
this->transaction_in_fw_path_id = img_ext->transaction_number;
246253

247254
unsigned int initiator_id = decode_address(address);
248-
dbgmodprint("Received transaction #%0d with address %016llX in forward path. Redirecting transaction through initiator %d", img_ext->transaction_number, address, initiator_id);
255+
dbgmodprint(use_prints, "Received transaction #%0d with address %016llX in forward path. Redirecting transaction through initiator %d", img_ext->transaction_number, address, initiator_id);
249256
(*initiator_socket[initiator_id])->nb_transport_fw(trans, local_phase, this->fw_delay);
250257
}
251258

0 commit comments

Comments
 (0)