|
14 | 14 | TRACER_BODY = '''
|
15 | 15 | // The tracer for the ${identifier} iDMA
|
16 | 16 | `define IDMA_TRACER_${identifier_cap}(__backend_inst, __out_f) <%text>\\</%text>
|
17 |
| -`ifndef SYNTHESYS <%text>\\</%text> |
18 |
| -`ifndef VERILATOR <%text>\\</%text> |
| 17 | +`ifndef SYNTHESIS <%text>\\</%text> |
19 | 18 | initial begin : inital_tracer_${identifier} <%text>\\</%text>
|
20 | 19 | automatic bit first_iter = 1; <%text>\\</%text>
|
21 | 20 | automatic integer tf; <%text>\\</%text>
|
22 | 21 | automatic `IDMA_TRACER_MAX_TYPE cnst [string]; <%text>\\</%text>
|
23 | 22 | automatic `IDMA_TRACER_MAX_TYPE meta [string]; <%text>\\</%text>
|
| 23 | + automatic `IDMA_TRACER_MAX_TYPE backend [string]; <%text>\\</%text> |
24 | 24 | automatic `IDMA_TRACER_MAX_TYPE busy [string]; <%text>\\</%text>
|
25 | 25 | automatic `IDMA_TRACER_MAX_TYPE bus [string]; <%text>\\</%text>
|
26 | 26 | automatic string trace; <%text>\\</%text>
|
| 27 | +`ifndef VERILATOR <%text>\\</%text> |
27 | 28 | #0; <%text>\\</%text>
|
| 29 | +`endif <%text>\\</%text> |
28 | 30 | tf = $fopen(__out_f, "w"); <%text>\\</%text>
|
29 | 31 | $display("[iDMA Tracer] Logging %s to %s", `"__backend_inst`", __out_f); <%text>\\</%text>
|
30 | 32 | forever begin <%text>\\</%text>
|
31 | 33 | @(posedge __backend_inst``.clk_i); <%text>\\</%text>
|
32 |
| - if(__backend_inst``.rst_ni & |__backend_inst``.busy_o) begin <%text>\\</%text> |
| 34 | + if(__backend_inst``.rst_ni & (|__backend_inst``.busy_o | <%text>\\</%text> |
| 35 | + __backend_inst``.req_valid_i | <%text>\\</%text> |
| 36 | + __backend_inst``.rsp_valid_o)) begin <%text>\\</%text> |
33 | 37 | /* Trace */ <%text>\\</%text>
|
34 | 38 | trace = "{"; <%text>\\</%text>
|
35 | 39 | /* Constants */ <%text>\\</%text>
|
|
55 | 59 | meta = '{ <%text>\\</%text>
|
56 | 60 | "time" : $time() <%text>\\</%text>
|
57 | 61 | }; <%text>\\</%text>
|
| 62 | + backend = '{ <%text>\\</%text> |
| 63 | + "req_valid" : __backend_inst``.req_valid_i, <%text>\\</%text> |
| 64 | + "req_ready" : __backend_inst``.req_ready_o, <%text>\\</%text> |
| 65 | + "rsp_valid" : __backend_inst``.rsp_valid_o, <%text>\\</%text> |
| 66 | + "rsp_ready" : __backend_inst``.rsp_ready_i, <%text>\\</%text> |
| 67 | + "req_length" : __backend_inst``.idma_req_i.length <%text>\\</%text> |
| 68 | + }; <%text>\\</%text> |
58 | 69 | busy = '{ <%text>\\</%text>
|
59 | 70 | "buffer" : __backend_inst``.busy_o.buffer_busy, <%text>\\</%text>
|
60 | 71 | "r_dp" : __backend_inst``.busy_o.r_dp_busy, <%text>\\</%text>
|
|
71 | 82 | /* Assembly */ <%text>\\</%text>
|
72 | 83 | `IDMA_TRACER_STR_ASSEMBLY(cnst, first_iter); <%text>\\</%text>
|
73 | 84 | `IDMA_TRACER_STR_ASSEMBLY(meta, 1); <%text>\\</%text>
|
| 85 | + `IDMA_TRACER_STR_ASSEMBLY(backend, 1); <%text>\\</%text> |
74 | 86 | `IDMA_TRACER_STR_ASSEMBLY(busy, 1); <%text>\\</%text>
|
75 | 87 | `IDMA_TRACER_STR_ASSEMBLY(bus, 1); <%text>\\</%text>
|
76 | 88 | `IDMA_TRACER_CLEAR_COND(first_iter); <%text>\\</%text>
|
|
79 | 91 | end <%text>\\</%text>
|
80 | 92 | end <%text>\\</%text>
|
81 | 93 | end <%text>\\</%text>
|
82 |
| -`endif <%text>\\</%text> |
83 | 94 | `endif
|
84 | 95 | '''
|
85 | 96 |
|
|
0 commit comments