用户工具

站点工具


协议学习:arm_dap

差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

两侧同时换到之前的修订记录前一修订版
后一修订版
前一修订版
协议学习:arm_dap [2024/12/12 10:27] – [3. DP register summary] user01协议学习:arm_dap [2024/12/12 17:41] (当前版本) – [5. verilog example code] user01
行 120: 行 120:
         repeat(len-1) begin         repeat(len-1) begin
             tck_cycle(1'b0, data[i]);             tck_cycle(1'b0, data[i]);
-            shift_ret[i] = sample_tdo; +            shift_ret[i] = sample_tdo; i = i+1;
-            i = i+1;+
         end         end
         tck_cycle(1'b1, data[i]);         tck_cycle(1'b1, data[i]);
 +            shift_ret[i] = sample_tdo; i = i+1;
         tck_cycle(1'b1, 1'b0);         tck_cycle(1'b1, 1'b0);
         tck_cycle(1'b0, 1'b0); // rti         tck_cycle(1'b0, 1'b0); // rti
行 143: 行 143:
         repeat(len-1) begin         repeat(len-1) begin
             tck_cycle(1'b0, data[i]);             tck_cycle(1'b0, data[i]);
-            shift_ret[i] = sample_tdo; +            shift_ret[i] = sample_tdo; i = i+1;
-            i = i+1;+
         end         end
         tck_cycle(1'b1, data[i]);         tck_cycle(1'b1, data[i]);
 +            shift_ret[i] = sample_tdo; i = i+1;
         tck_cycle(1'b1, 1'b0);         tck_cycle(1'b1, 1'b0);
         tck_cycle(1'b0, 1'b0); // rti         tck_cycle(1'b0, 1'b0); // rti
行 159: 行 159:
     input   [7:0] ap_addr;     input   [7:0] ap_addr;
     input   [31:0] ap_data;     input   [31:0] ap_data;
 +
 +    reg     [7:0] ap_sel;
  
     begin     begin
行 166: 行 168:
     #1000;     #1000;
     //shift_dr(35, 35'h0); // 32b data, 2b A[3:2] (1:ctrl, 2:ap-sel, 3:read-buffer), 1b RnW (0:write)     //shift_dr(35, 35'h0); // 32b data, 2b A[3:2] (1:ctrl, 2:ap-sel, 3:read-buffer), 1b RnW (0:write)
-    shift_dr(35, {{8'h02,16'h0, ap_addr[7:4],4'h0} , 2'h2, 1'b0}); // ap_sel = select ahb-ap   (31:24 ap_sel, 7:4 ap_banksel)+    ap_sel = 8'h0; 
 +    shift_dr(35, {{ap_sel,16'h0, ap_addr[7:4],4'h0} , 2'h2, 1'b0}); // ap_sel = select ahb-ap   (31:24 ap_sel, 7:4 ap_banksel)
     #1000;     #1000;
  
行 190: 行 193:
     input   [31:0] ap_data;     input   [31:0] ap_data;
  
-    reg [31:0] xpacc_data+    reg     [7:0] ap_sel
-    reg [2:0] ack; +
-  +
     begin     begin
  
行 199: 行 201:
     #1000;     #1000;
     //shift_dr(35, 35'h0); // 32b data, 2b A[3:2] (1:ctrl, 2:ap-sel, 3:read-buffer), 1b RnW (0:write)     //shift_dr(35, 35'h0); // 32b data, 2b A[3:2] (1:ctrl, 2:ap-sel, 3:read-buffer), 1b RnW (0:write)
-    shift_dr(35, {{8'h02,16'h0, ap_addr[7:4],4'h0} , 2'h2, 1'b0}); // ap_sel = select ahb-ap   (31:24 ap_sel, 7:4 ap_banksel)+    ap_sel = 8'h0; 
 +    shift_dr(35, {{ap_sel,16'h0, ap_addr[7:4],4'h0} , 2'h2, 1'b0}); // ap_sel = select ahb-ap   (31:24 ap_sel, 7:4 ap_banksel)
     #1000;     #1000;
  
行 217: 行 220:
     #1000;     #1000;
  
- +
     // dpacc.reserved     // dpacc.reserved
     shift_ir(4, 4'ha);     shift_ir(4, 4'ha);
     #1000;     #1000;
-    repeat(10) begin +    shift_dr(35, {32'h0 , 2'h0, 1'b0}); // for read ap buffer only, (ret data is in [34:3]) 
-        shift_dr(35, {32'h0 , 2'h0, 1'b0}); // for read ap buffer only, (ret data is in [34:3]) +    #1000;
-        xpacc_data = shift_ret[34:3]; +
-        ack = shift_ret[2:0]; +
-        $display("----xpacc_data ret = %8h, ack = ", xpacc_data, ack); +
-        if (ack == 3'h2) break; +
-    end +
-    #1000;    +
-       +
-       +
-      +
     end     end
 endtask endtask
行 280: 行 274:
 end end
  
-task ahb_read; 
-    input [31:0] ahb_addr; 
-    reg [31:0] ahb_data; 
-    begin 
-    //    // idcode 
-    //    shift_ir(4, 4'he); 
-    //    #1000; 
-    //    shift_dr(32, 32'h0); 
-    //    #1000; 
-        ahbap_write(8'h4, ahb_addr); 
-        ahbap_read(8'hc, 32'h0); 
-        ahb_data = shift_ret[34:3]; 
-        $display("ahb_read ret = %8h", ahb_data); 
-    end 
-endtask 
  
 endmodule endmodule
协议学习/arm_dap.1733970474.txt.gz · 最后更改: 2024/12/12 10:27 由 user01

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki