@@ -17,6 +17,8 @@ using namespace std;
1717
1818void ips_filter_tlm::do_when_read_transaction (unsigned char *& data, unsigned int data_length, sc_dt::uint64 address)
1919{
20+ dbgimgtarmodprint (" Called do_when_read_transaction with an address %016llX and length %d" , address, data_length);
21+
2022 this ->img_result = *(Filter<IPS_IN_TYPE_TB, IPS_OUT_TYPE_TB, IPS_FILTER_KERNEL_SIZE>::result_ptr);
2123 *data = (unsigned char ) this ->img_result ;
2224 // memcpy(data, Filter<IPS_IN_TYPE_TB, IPS_OUT_TYPE_TB, IPS_FILTER_KERNEL_SIZE>::result_ptr, sizeof(IPS_OUT_TYPE_TB));
@@ -25,25 +27,15 @@ void ips_filter_tlm::do_when_read_transaction(unsigned char*& data, unsigned int
2527void ips_filter_tlm::do_when_write_transaction (unsigned char *& data, unsigned int data_length, sc_dt::uint64 address)
2628{
2729 IPS_OUT_TYPE_TB* result = new IPS_OUT_TYPE_TB;
28- IPS_IN_TYPE_TB* img_window = new IPS_IN_TYPE_TB[3 * 3 ];
29-
30- dbgprint (" [DEBUG]: data: %0d, address %0d, data_length %0d, size of char %0d" , *data, address, data_length, sizeof (char ));
31- this ->img_window [address] = (IPS_IN_TYPE_TB) *data;
32- dbgprint (" [DEBUG]: img_window data: %0f" , this ->img_window [address]);
33-
34- // if ((IPS_FILTER_KERNEL_SIZE * IPS_FILTER_KERNEL_SIZE * sizeof(char)) != data_length)
35- // {
36- // SC_REPORT_FATAL("IPS_FILTER", "Illegal transaction size");
37- // }
38-
39- // for (int i = 0; i < IPS_FILTER_KERNEL_SIZE; i++)
40- // {
41- // for (int j = 0; j < IPS_FILTER_KERNEL_SIZE; j++)
42- // {
43- // *(img_window + ((i * IPS_FILTER_KERNEL_SIZE) + j)) = (IPS_IN_TYPE_TB)*(data + ((i * IPS_FILTER_KERNEL_SIZE) + j));
44- // this->img_window[(i * IPS_FILTER_KERNEL_SIZE) + j] = (IPS_IN_TYPE_TB)*(data + ((i * IPS_FILTER_KERNEL_SIZE) + j));
45- // }
46- // }
30+
31+ dbgimgtarmodprint (" Called do_when_write_transaction with an address %016llX and length %d" , address, data_length);
32+
33+ // dbgprint("[DEBUG]: data: %0d, address %0d, data_length %0d, size of char %0d", *data, address, data_length, sizeof(char));
34+ for (int i = 0 ; i < data_length; i++) {
35+ this ->img_window [address + i] = (IPS_IN_TYPE_TB) *(data + i);
36+ }
37+ // dbgprint("[DEBUG]: img_window data: %0f", this->img_window[address]);
38+
4739 if (address == 8 ) {
4840 filter (this ->img_window , result);
4941 }
0 commit comments