axi_tdl 0.1.1 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +7 -0
  3. data/lib/axi/AXI4/axi4_direct_A1.sv +1 -1
  4. data/lib/axi/AXI4/axi4_direct_verc.sv +54 -54
  5. data/lib/axi/AXI4/axi4_dpram_cache.sv +2 -2
  6. data/lib/axi/AXI4/axis_to_axi4_wr.sv +8 -8
  7. data/lib/axi/AXI4/odata_pool_axi4_A3.sv +7 -0
  8. data/lib/axi/AXI4/packet_partition/axi4_partition_rd_verb.sv +1 -1
  9. data/lib/axi/AXI4/packet_partition/data_inf_partition.sv +2 -2
  10. data/lib/axi/AXI4/wide_axis_to_axi4_wr.sv +8 -8
  11. data/lib/axi/AXI_stream/axi_stream_split_channel.sv +154 -0
  12. data/lib/axi/AXI_stream/axis_head_cut_verc.sv +242 -0
  13. data/lib/axi/AXI_stream/axis_insert_copy.sv +79 -0
  14. data/lib/axi/AXI_stream/axis_pipe_sync_seam.sv +48 -0
  15. data/lib/axi/AXI_stream/axis_rom_contect_sim.sv +113 -0
  16. data/lib/axi/AXI_stream/axis_sim_master_model.rb +2 -0
  17. data/lib/axi/AXI_stream/axis_sim_master_model.sv +46 -0
  18. data/lib/axi/AXI_stream/axis_split_channel_verb.sv +62 -0
  19. data/lib/axi/common/common_ram_sim_wrapper.sv +1 -1
  20. data/lib/axi/common/common_ram_wrapper.sv +1 -1
  21. data/lib/axi/data_interface/data_inf_c/data_c_pipe_sync_seam.sv +11 -11
  22. data/lib/axi/data_interface/data_inf_c/data_c_sim_master_model.sv +14 -11
  23. data/lib/axi/platform_ip/fifo_36kb_long.sv +1 -1
  24. data/lib/axi/techbench/tb_axi_stream_split_channel.rb +1 -1
  25. data/lib/axi/techbench/tb_axi_stream_split_channel.sv +46 -45
  26. data/lib/axi_tdl/version.rb +1 -1
  27. data/lib/public_atom_module/CheckPClock.sv +53 -0
  28. data/lib/public_atom_module/LICENSE.md +674 -0
  29. data/lib/public_atom_module/altera_xilinx_always_block_sw.rb +57 -0
  30. data/lib/public_atom_module/bits_decode.sv +71 -0
  31. data/lib/public_atom_module/bits_decode_verb.sv +71 -0
  32. data/lib/public_atom_module/bits_decode_verb_sdl.rb +24 -0
  33. data/lib/public_atom_module/broaden.v +43 -0
  34. data/lib/public_atom_module/broaden_and_cross_clk.v +47 -0
  35. data/lib/public_atom_module/ceiling.v +39 -0
  36. data/lib/public_atom_module/ceiling_A1.v +42 -0
  37. data/lib/public_atom_module/clock_rst.sv +64 -0
  38. data/lib/public_atom_module/cross_clk_sync.v +37 -0
  39. data/lib/public_atom_module/edge_generator.v +50 -0
  40. data/lib/public_atom_module/flooring.v +36 -0
  41. data/lib/public_atom_module/latch_data.v +30 -0
  42. data/lib/public_atom_module/latency.v +48 -0
  43. data/lib/public_atom_module/latency_dynamic.v +83 -0
  44. data/lib/public_atom_module/latency_long.v +84 -0
  45. data/lib/public_atom_module/latency_verb.v +52 -0
  46. data/lib/public_atom_module/once_event.sv +65 -0
  47. data/lib/public_atom_module/pipe_reg.v +93 -0
  48. data/lib/public_atom_module/pipe_reg_2write_ports.v +84 -0
  49. data/lib/public_atom_module/sim/clock_rst_verb.sv +54 -0
  50. data/lib/public_atom_module/sim/latency_long_tb.sv +49 -0
  51. data/lib/public_atom_module/sim/latency_long_tb.sv.bak +49 -0
  52. data/lib/tdl/Logic/logic_edge.rb +1 -1
  53. data/lib/tdl/axi4/axi4_interconnect_verb.rb +46 -9
  54. data/lib/tdl/class_hdl/hdl_always_comb.rb +4 -1
  55. data/lib/tdl/class_hdl/hdl_always_ff.rb +2 -2
  56. data/lib/tdl/class_hdl/hdl_assign.rb +7 -1
  57. data/lib/tdl/class_hdl/hdl_block_ifelse.rb +7 -7
  58. data/lib/tdl/class_hdl/hdl_foreach.rb +2 -2
  59. data/lib/tdl/class_hdl/hdl_function.rb +4 -4
  60. data/lib/tdl/class_hdl/hdl_generate.rb +4 -1
  61. data/lib/tdl/class_hdl/hdl_initial.rb +25 -3
  62. data/lib/tdl/class_hdl/hdl_module_def.rb +9 -6
  63. data/lib/tdl/class_hdl/hdl_package.rb +45 -0
  64. data/lib/tdl/class_hdl/hdl_redefine_opertor.rb +99 -27
  65. data/lib/tdl/class_hdl/hdl_struct.rb +2 -2
  66. data/lib/tdl/elements/Reset.rb +5 -9
  67. data/lib/tdl/elements/clock.rb +5 -9
  68. data/lib/tdl/elements/data_inf.rb +0 -17
  69. data/lib/tdl/elements/logic.rb +9 -31
  70. data/lib/tdl/elements/mail_box.rb +6 -1
  71. data/lib/tdl/elements/originclass.rb +17 -47
  72. data/lib/tdl/elements/parameter.rb +5 -6
  73. data/lib/tdl/examples/11_test_unit/dve.tcl +6 -153
  74. data/lib/tdl/examples/11_test_unit/exp_test_unit.sv +1 -1
  75. data/lib/tdl/examples/11_test_unit/modules/sub_md0.sv +1 -1
  76. data/lib/tdl/examples/11_test_unit/tb_exp_test_unit.sv +1 -3
  77. data/lib/tdl/examples/11_test_unit/tb_exp_test_unit_sim.sv +1 -2
  78. data/lib/tdl/examples/11_test_unit/tu0.sv +1 -1
  79. data/lib/tdl/examples/1_define_module/exmple_md.sv +1 -1
  80. data/lib/tdl/examples/2_hdl_class/tmp/module_instance_test.sv +1 -1
  81. data/lib/tdl/examples/2_hdl_class/tmp/test_inst_sugar.sv +1 -1
  82. data/lib/tdl/examples/2_hdl_class/tmp/test_module.sv +3 -3
  83. data/lib/tdl/examples/2_hdl_class/tmp/test_module_port.sv +1 -1
  84. data/lib/tdl/examples/2_hdl_class/tmp/test_module_var.sv +1 -1
  85. data/lib/tdl/examples/2_hdl_class/tmp/test_package.sv +4 -3
  86. data/lib/tdl/examples/2_hdl_class/tmp/test_vcs_string.sv +1 -1
  87. data/lib/tdl/examples/3_hdl_sdl_instance/main_md.sv +1 -1
  88. data/lib/tdl/examples/3_hdl_sdl_instance/sdl_md.sv +1 -1
  89. data/lib/tdl/examples/6_module_with_interface/inf_collect.sv +1 -1
  90. data/lib/tdl/examples/7_module_with_package/body_package.sv +4 -3
  91. data/lib/tdl/examples/7_module_with_package/example_pkg.sv +1 -1
  92. data/lib/tdl/examples/7_module_with_package/head_package.sv +4 -3
  93. data/lib/tdl/examples/8_top_module/dve.tcl +2 -155
  94. data/lib/tdl/examples/8_top_module/tb_test_top.sv +1 -1
  95. data/lib/tdl/examples/8_top_module/tb_test_top_sim.sv +1 -1
  96. data/lib/tdl/examples/8_top_module/test_top.sv +1 -1
  97. data/lib/tdl/examples/9_itegration/dve.tcl +2 -155
  98. data/lib/tdl/examples/9_itegration/tb_test_tttop.sv +3 -1
  99. data/lib/tdl/examples/9_itegration/tb_test_tttop_sim.sv +1 -1
  100. data/lib/tdl/examples/9_itegration/test_tttop.sv +1 -1
  101. data/lib/tdl/exlib/axis_verify.rb +4 -3
  102. data/lib/tdl/rebuild_ele/ele_base.rb +8 -8
  103. data/lib/tdl/sdlmodule/sdlmodule.rb +61 -51
  104. data/lib/tdl/sdlmodule/sdlmodule_arraychain.rb +1 -1
  105. data/lib/tdl/sdlmodule/sdlmodule_instance.rb +3 -0
  106. data/lib/tdl/sdlmodule/sdlmodule_port_define.rb +6 -6
  107. data/lib/tdl/sdlmodule/sdlmodule_varible.rb +6 -6
  108. data/lib/tdl/sdlmodule/test_unit_module.rb +5 -0
  109. data/lib/tdl/tdlerror/tdlerror.rb +1 -1
  110. metadata +34 -3
  111. data/lib/axi/AXI_stream/axis_length_split_writh_user.sv +0 -87
@@ -3,6 +3,7 @@ require_hdl 'data_c_sim_master_model.sv'
3
3
  TdlBuild.axis_sim_master_model(__dir__) do
4
4
  parameter.LOOP "TRUE"
5
5
  parameter.RAM_DEPTH 10000
6
+ input - 'enable'
6
7
  input - 'load_trigger'
7
8
  input[32] - 'total_length'
8
9
  input[512*8] - 'mem_file' # {axis_tvalid, axis_tuser, axis_tkeep, axis_tlast, axis_tdata}
@@ -13,6 +14,7 @@ TdlBuild.axis_sim_master_model(__dir__) do
13
14
  data_c_sim_master_model.data_c_sim_master_model_inst do |h| #(
14
15
  h.param.LOOP param.LOOP
15
16
  h.param.RAM_DEPTH param.RAM_DEPTH
17
+ h.input.enable enable
16
18
  h.input.load_trigger load_trigger
17
19
  h.input[32].total_length total_length
18
20
  h.input[512*8].mem_file mem_file
@@ -0,0 +1,46 @@
1
+ /**********************************************
2
+ _______________________________________
3
+ ___________ Cook Darwin __________
4
+ _______________________________________
5
+ descript:
6
+ author : Cook.Darwin
7
+ Version: VERA.0.0
8
+ created: 2021-04-03 12:04:15 +0800
9
+ madified:
10
+ ***********************************************/
11
+ `timescale 1ns/1ps
12
+
13
+ module axis_sim_master_model #(
14
+ parameter LOOP = "TRUE",
15
+ parameter RAM_DEPTH = 10000
16
+ )(
17
+ input enable,
18
+ input load_trigger,
19
+ input [31:0] total_length,
20
+ input [4095:0] mem_file,
21
+ axi_stream_inf.master out_inf
22
+ );
23
+
24
+ //==========================================================================
25
+ //-------- define ----------------------------------------------------------
26
+
27
+ data_inf_c #(.DSIZE(out_inf.DSIZE + out_inf.KSIZE + out_inf.USIZE + 1)) out_inf_dc (.clock(out_inf.aclk),.rst_n(out_inf.aresetn)) ;
28
+ //==========================================================================
29
+ //-------- instance --------------------------------------------------------
30
+ data_c_sim_master_model #(
31
+ .LOOP (LOOP ),
32
+ .RAM_DEPTH (RAM_DEPTH )
33
+ )data_c_sim_master_model_inst(
34
+ /* input */.enable (enable ),
35
+ /* input */.load_trigger (load_trigger ),
36
+ /* input */.total_length (total_length ),
37
+ /* input */.mem_file (mem_file ),
38
+ /* data_inf_c.master */.out_inf (out_inf_dc )
39
+ );
40
+ //==========================================================================
41
+ //-------- expression ------------------------------------------------------
42
+ assign out_inf.axis_tvalid = out_inf_dc.valid;
43
+ assign out_inf_dc.ready = out_inf.axis_tready;
44
+ assign {>>{out_inf.axis_tuser,out_inf.axis_tkeep,out_inf.axis_tlast,out_inf.axis_tdata}} = out_inf_dc.data;
45
+
46
+ endmodule
@@ -0,0 +1,62 @@
1
+ /**********************************************
2
+ _______________________________________
3
+ ___________ Cook Darwin __________
4
+ _______________________________________
5
+ descript:
6
+ author : Cook.Darwin
7
+ Version: VERA.0.0
8
+ creaded: XXXX.XX.XX
9
+ madified:
10
+ ***********************************************/
11
+ `timescale 1ns/1ps
12
+
13
+ module axis_split_channel_verb (
14
+ input [15:0] split_len,
15
+ axi_stream_inf.slaver origin_inf,
16
+ axi_stream_inf.master first_inf,
17
+ axi_stream_inf.master end_inf
18
+ );
19
+
20
+ //==========================================================================
21
+ //-------- define ----------------------------------------------------------
22
+ logic clock;
23
+ logic rst_n;
24
+ logic [16-1:0] insert_seed ;
25
+ logic [16-1:0] next_split_len ;
26
+ axi_stream_inf #(.DSIZE(origin_inf.DSIZE),.USIZE(1)) origin_inf_insert (.aclk(origin_inf.aclk),.aresetn(origin_inf.aresetn),.aclken(1'b1)) ;
27
+ //==========================================================================
28
+ //-------- instance --------------------------------------------------------
29
+ axis_insert_copy axis_insert_copy_inst(
30
+ /* input */.insert_seed (insert_seed ),
31
+ /* input */.insert_len (8'd1 ),
32
+ /* axi_stream_inf.slaver */.in_inf (origin_inf ),
33
+ /* axi_stream_inf.master */.out_inf (origin_inf_insert )
34
+ );
35
+ common_fifo #(
36
+ .DEPTH (4 ),
37
+ .DSIZE (16 )
38
+ )common_fifo_head_bytesx_inst(
39
+ /* input */.clock (clock ),
40
+ /* input */.rst_n (rst_n ),
41
+ /* input */.wdata (split_len ),
42
+ /* input */.wr_en ((origin_inf.axis_tcnt == '0) && origin_inf.axis_tvalid && origin_inf.axis_tready ),
43
+ /* output */.rdata (next_split_len ),
44
+ /* input */.rd_en (origin_inf_insert.axis_tvalid && origin_inf_insert.axis_tready && origin_inf_insert.axis_tlast ),
45
+ /* output */.count (/*unused */ ),
46
+ /* output */.empty (/*unused */ ),
47
+ /* output */.full (/*unused */ )
48
+ );
49
+ axi_stream_split_channel axi_stream_split_channel_inst(
50
+ /* input */.split_len (next_split_len ),
51
+ /* axi_stream_inf.slaver */.origin_inf (origin_inf_insert ),
52
+ /* axi_stream_inf.master */.first_inf (first_inf ),
53
+ /* axi_stream_inf.master */.end_inf (end_inf )
54
+ );
55
+ //==========================================================================
56
+ //-------- expression ------------------------------------------------------
57
+ assign clock = origin_inf.aclk;
58
+ assign rst_n = origin_inf.aresetn;
59
+
60
+ assign insert_seed = split_len-1'b1;
61
+
62
+ endmodule
@@ -5,7 +5,7 @@ _______________________________________
5
5
  descript:
6
6
  author : Cook.Darwin
7
7
  Version: VERA.0.0
8
- created: xxxx.xx.xx
8
+ creaded: XXXX.XX.XX
9
9
  madified:
10
10
  ***********************************************/
11
11
  `timescale 1ns/1ps
@@ -5,7 +5,7 @@ _______________________________________
5
5
  descript:
6
6
  author : Cook.Darwin
7
7
  Version: VERA.0.0
8
- created: xxxx.xx.xx
8
+ creaded: XXXX.XX.XX
9
9
  madified:
10
10
  ***********************************************/
11
11
  `timescale 1ns/1ps
@@ -5,7 +5,7 @@ _______________________________________
5
5
  descript:
6
6
  author : Cook.Darwin
7
7
  Version: VERA.0.0
8
- created: xxxx.xx.xx
8
+ creaded: XXXX.XX.XX
9
9
  madified:
10
10
  ***********************************************/
11
11
  `timescale 1ns/1ps
@@ -48,22 +48,22 @@ for(genvar KK0=0;KK0 < LAT;KK0++)begin
48
48
  endgenerate
49
49
  //-------- CLOCKs Total 2 ----------------------
50
50
  //--->> CheckClock <<----------------
51
- logic cc_done_7,cc_same_7;
52
- integer cc_afreq_7,cc_bfreq_7;
53
- ClockSameDomain CheckPClock_inst_7(
51
+ logic cc_done_9,cc_same_9;
52
+ integer cc_afreq_9,cc_bfreq_9;
53
+ ClockSameDomain CheckPClock_inst_9(
54
54
  /* input */ .aclk (in_inf.clock ),
55
55
  /* input */ .bclk (out_inf.clock ),
56
- /* output logic */ .done (cc_done_7),
57
- /* output logic */ .same (cc_same_7),
58
- /* output integer */ .aFreqK (cc_afreq_7),
59
- /* output integer */ .bFreqK (cc_bfreq_7)
56
+ /* output logic */ .done (cc_done_9),
57
+ /* output logic */ .same (cc_same_9),
58
+ /* output integer */ .aFreqK (cc_afreq_9),
59
+ /* output integer */ .bFreqK (cc_bfreq_9)
60
60
  );
61
61
 
62
62
  initial begin
63
- wait(cc_done_7);
64
- assert(cc_same_7)
63
+ wait(cc_done_9);
64
+ assert(cc_same_9)
65
65
  else begin
66
- $error("--- Error : `data_c_pipe_sync_seam` clock is not same, in_inf.clock< %0f M> != out_inf.clock<%0f M>",1000000.0/cc_afreq_7, 1000000.0/cc_bfreq_7);
66
+ $error("--- Error : `data_c_pipe_sync_seam` clock is not same, in_inf.clock< %0f M> != out_inf.clock<%0f M>",1000000.0/cc_afreq_9, 1000000.0/cc_bfreq_9);
67
67
  repeat(10)begin
68
68
  @(posedge in_inf.clock);
69
69
  end
@@ -13,6 +13,7 @@ module data_c_sim_master_model #(
13
13
  parameter LOOP = "TRUE",
14
14
  parameter RAM_DEPTH = 10000
15
15
  )(
16
+ input enable,
16
17
  input load_trigger,
17
18
  input [31:0] total_length,
18
19
  input[512*8-1:0] mem_file,
@@ -46,24 +47,26 @@ end
46
47
  always@(posedge out_inf.clock) begin
47
48
  if(~out_inf.rst_n) index <= 0;
48
49
  else begin
49
- if(out_inf.ready) begin
50
- if(index >= total_length_lock-1)begin
51
- if(LOOP == "TRUE" || LOOP == "ON")begin
52
- index <= 0;
50
+ if(enable)begin
51
+ if(out_inf.ready) begin
52
+ if(index >= total_length_lock-1)begin
53
+ if(LOOP == "TRUE" || LOOP == "ON")begin
54
+ index <= 0;
55
+ end else begin
56
+ index <= total_length_lock-1;
57
+ disable_coe <= 1'b1;
58
+ end
53
59
  end else begin
54
- index <= total_length_lock-1;
55
- disable_coe <= 1'b1;
60
+ index <= index + 1;
56
61
  end
57
62
  end else begin
58
- index <= index + 1;
63
+ index <= index;
59
64
  end
60
- end else begin
61
- index <= index;
62
- end
65
+ end
63
66
  end
64
67
  end
65
68
 
66
69
  assign out_inf.data = BRAM[index][out_inf.DSIZE-1:0];
67
- assign out_inf.valid = BRAM[index][out_inf.DSIZE] && ~disable_coe;
70
+ assign out_inf.valid = BRAM[index][out_inf.DSIZE] && ~disable_coe && enable;
68
71
 
69
72
  endmodule
@@ -53,7 +53,7 @@ localparam DIV = ((DSIZE>=37) && (DSIZE<=72)) ? 512 :
53
53
  ((DSIZE>=5 ) && (DSIZE<=9 )) ? 4096 :
54
54
  ((DSIZE>=1 ) && (DSIZE<=4 )) ? 8192 : 8192;
55
55
 
56
- localparam KNUM = DEPTH/DIV;
56
+ localparam KNUM = DEPTH/DIV + (DEPTH/DIV == 0);
57
57
 
58
58
  // FIFO_DUALCLOCK_MACRO: Dual Clock First-In, First-Out (FIFO) RAM Buffer
59
59
  // Artix-7
@@ -1,4 +1,4 @@
1
- require 'axi_tdl'
1
+ require_relative '../../axi_tdl.rb'
2
2
  require_sdl 'axi_stream_split_channel.rb'
3
3
 
4
4
  TdlBuild.tb_axi_stream_split_channel(__dir__) do
@@ -5,7 +5,7 @@ _______________________________________
5
5
  descript:
6
6
  author : Cook.Darwin
7
7
  Version: VERA.0.0
8
- created: xxxx.xx.xx
8
+ created: 2021-04-03 12:04:15 +0800
9
9
  madified:
10
10
  ***********************************************/
11
11
  `timescale 1ns/1ps
@@ -36,113 +36,114 @@ logic_sim_model #(
36
36
  .DSIZE (16 ),
37
37
  .RAM_DEPTH (8 )
38
38
  )split_len_sim_model_inst(
39
- /* input */.next_at_negedge_of (origin_inf.axis_tvalid && origin_inf.axis_tready && origin_inf.axis_tlast ),
40
- /* input */.next_at_posedge_of (1'b0 ),
41
- /* input */.load_trigger (1'b0 ),
42
- /* input */.total_length (8 ),
43
- /* input */.mem_file ("/var/lib/gems/2.5.0/gems/axi_tdl-0.0.10/lib/tdl/auto_script/tmp/split_len_R1712.coe" ),
44
- /* output */.data (split_len )
39
+ /* input */.next_at_negedge_of (origin_inf.axis_tvalid && origin_inf.axis_tready && origin_inf.axis_tlast ),
40
+ /* input */.next_at_posedge_of (1'b0 ),
41
+ /* input */.load_trigger (1'b0 ),
42
+ /* input */.total_length (8 ),
43
+ /* input */.mem_file ("/home/wmy367/work/gem/axi_tdl/lib/tdl/auto_script/tmp/split_len_R674.coe" ),
44
+ /* output */.data (split_len )
45
45
  );
46
46
  axis_sim_master_model #(
47
47
  .LOOP ("TRUE" ),
48
48
  .RAM_DEPTH (246 )
49
49
  )sim_model_inst_origin_inf(
50
- /* input */.load_trigger (1'b0 ),
51
- /* input */.total_length (246 ),
52
- /* input */.mem_file ("/var/lib/gems/2.5.0/gems/axi_tdl-0.0.10/lib/tdl/auto_script/tmp/origin_inf_R560.coe" ),
53
- /* axi_stream_inf.master */.out_inf (origin_inf )
50
+ /* input */.enable (/*unused */ ),
51
+ /* input */.load_trigger (1'b0 ),
52
+ /* input */.total_length (246 ),
53
+ /* input */.mem_file ("/home/wmy367/work/gem/axi_tdl/lib/tdl/auto_script/tmp/origin_inf_R1699.coe" ),
54
+ /* axi_stream_inf.master */.out_inf (origin_inf )
54
55
  );
55
56
  axis_sim_verify_by_coe #(
56
57
  .RAM_DEPTH (21 ),
57
58
  .VERIFY_KEEP ("OFF" ),
58
59
  .VERIFY_USER ("OFF" )
59
60
  )axis_sim_verify_by_coe_inst_first_inf(
60
- /* input */.load_trigger (1'b0 ),
61
- /* input */.total_length (21 ),
62
- /* input */.mem_file ("/var/lib/gems/2.5.0/gems/axi_tdl-0.0.10/lib/tdl/auto_script/tmp/first_inf_R1297.coe" ),
63
- /* axi_stream_inf.mirror */.mirror_inf (first_inf )
61
+ /* input */.load_trigger (1'b0 ),
62
+ /* input */.total_length (21 ),
63
+ /* input */.mem_file ("/home/wmy367/work/gem/axi_tdl/lib/tdl/auto_script/tmp/first_inf_R1282.coe" ),
64
+ /* axi_stream_inf.mirror */.mirror_inf (first_inf )
64
65
  );
65
66
  axis_sim_verify_by_coe #(
66
67
  .RAM_DEPTH (113 ),
67
68
  .VERIFY_KEEP ("OFF" ),
68
69
  .VERIFY_USER ("OFF" )
69
70
  )axis_sim_verify_by_coe_inst_end_inf(
70
- /* input */.load_trigger (1'b0 ),
71
- /* input */.total_length (113 ),
72
- /* input */.mem_file ("/var/lib/gems/2.5.0/gems/axi_tdl-0.0.10/lib/tdl/auto_script/tmp/end_inf_R1464.coe" ),
73
- /* axi_stream_inf.mirror */.mirror_inf (end_inf )
71
+ /* input */.load_trigger (1'b0 ),
72
+ /* input */.total_length (113 ),
73
+ /* input */.mem_file ("/home/wmy367/work/gem/axi_tdl/lib/tdl/auto_script/tmp/end_inf_R1315.coe" ),
74
+ /* axi_stream_inf.mirror */.mirror_inf (end_inf )
74
75
  );
75
76
  //==========================================================================
76
77
  //-------- expression ------------------------------------------------------
77
78
  initial begin
78
- clock = 1'b0;
79
- #(100ns);
80
- forever begin #(5.0ns);clock = ~clock;end;
79
+ clock = 1'b0;
80
+ #(100ns);
81
+ forever begin #(5.0ns);clock = ~clock;end;
81
82
  end
82
83
 
83
84
  initial begin
84
- rst_n = 1'b0;
85
- #(200ns);
86
- rst_n = ~rst_n;
85
+ rst_n = 1'b0;
86
+ #(200ns);
87
+ rst_n = ~rst_n;
87
88
  end
88
89
 
89
90
  initial begin
90
- first_inf_rdy_percetage_index = 0;
91
- first_inf_rdy_percetage[0] = 50;
92
- first_inf_rdy_percetage[1] = 100;
93
- first_inf_rdy_percetage[2] = 30;
91
+ first_inf_rdy_percetage_index = 0;
92
+ first_inf_rdy_percetage[0] = 50;
93
+ first_inf_rdy_percetage[1] = 100;
94
+ first_inf_rdy_percetage[2] = 30;
94
95
  end
95
96
 
96
97
  always@(posedge clock) begin
97
98
  if(first_inf.axis_tvalid && first_inf.axis_tready && first_inf.axis_tlast)begin
98
- if( first_inf_rdy_percetage_index>=( 3-1))begin
99
- first_inf_rdy_percetage_index <= 0;
99
+ if(first_inf_rdy_percetage_index>=(3-1))begin
100
+ first_inf_rdy_percetage_index <= 0;
100
101
  end
101
102
  else begin
102
- first_inf_rdy_percetage_index <= ( first_inf_rdy_percetage_index+1'b1);
103
+ first_inf_rdy_percetage_index <= (first_inf_rdy_percetage_index+1'b1);
103
104
  end
104
105
  end
105
106
  else begin
106
- first_inf_rdy_percetage_index <= first_inf_rdy_percetage_index;
107
+ first_inf_rdy_percetage_index <= first_inf_rdy_percetage_index;
107
108
  end
108
109
  end
109
110
 
110
111
  always@(posedge clock) begin
111
112
  if(~rst_n)begin
112
- first_inf.axis_tready <= 1'b0;
113
+ first_inf.axis_tready <= 1'b0;
113
114
  end
114
115
  else begin
115
- first_inf.axis_tready <= ($urandom_range(0,99) <= first_inf_rdy_percetage[first_inf_rdy_percetage_index]);
116
+ first_inf.axis_tready <= ($urandom_range(0,99) <= first_inf_rdy_percetage[first_inf_rdy_percetage_index]);
116
117
  end
117
118
  end
118
119
 
119
120
  initial begin
120
- end_inf_rdy_percetage_index = 0;
121
- end_inf_rdy_percetage[0] = 100;
122
- end_inf_rdy_percetage[1] = 50;
123
- end_inf_rdy_percetage[2] = 100;
121
+ end_inf_rdy_percetage_index = 0;
122
+ end_inf_rdy_percetage[0] = 100;
123
+ end_inf_rdy_percetage[1] = 50;
124
+ end_inf_rdy_percetage[2] = 100;
124
125
  end
125
126
 
126
127
  always@(posedge clock) begin
127
128
  if(end_inf.axis_tvalid && end_inf.axis_tready && end_inf.axis_tlast)begin
128
- if( end_inf_rdy_percetage_index>=( 3-1))begin
129
- end_inf_rdy_percetage_index <= 0;
129
+ if(end_inf_rdy_percetage_index>=(3-1))begin
130
+ end_inf_rdy_percetage_index <= 0;
130
131
  end
131
132
  else begin
132
- end_inf_rdy_percetage_index <= ( end_inf_rdy_percetage_index+1'b1);
133
+ end_inf_rdy_percetage_index <= (end_inf_rdy_percetage_index+1'b1);
133
134
  end
134
135
  end
135
136
  else begin
136
- end_inf_rdy_percetage_index <= end_inf_rdy_percetage_index;
137
+ end_inf_rdy_percetage_index <= end_inf_rdy_percetage_index;
137
138
  end
138
139
  end
139
140
 
140
141
  always@(posedge clock) begin
141
142
  if(~rst_n)begin
142
- end_inf.axis_tready <= 1'b0;
143
+ end_inf.axis_tready <= 1'b0;
143
144
  end
144
145
  else begin
145
- end_inf.axis_tready <= ($urandom_range(0,99) <= end_inf_rdy_percetage[end_inf_rdy_percetage_index]);
146
+ end_inf.axis_tready <= ($urandom_range(0,99) <= end_inf_rdy_percetage[end_inf_rdy_percetage_index]);
146
147
  end
147
148
  end
148
149
 
@@ -1,3 +1,3 @@
1
1
  module AxiTdl
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -0,0 +1,53 @@
1
+ /**********************************************
2
+ ______________ ______________
3
+ ______________ \ /\ /|\ /| ______________
4
+ ______________ \/ \/ | \/ | ______________
5
+ descript:
6
+ author : Young
7
+ Version:
8
+ creaded: xxxx.xx.xx
9
+ madified:
10
+ ***********************************************/
11
+ `timescale 1ns/1ps
12
+ module CheckPClock (
13
+ input aclk,
14
+ input bclk,
15
+ output logic done,
16
+ output logic same
17
+ );
18
+
19
+
20
+ realtime a2b;
21
+ realtime b2a;
22
+
23
+
24
+ initial begin
25
+ done = 0;
26
+ same = 1;
27
+ repeat(100)begin
28
+ @(posedge aclk);
29
+ @(posedge bclk);
30
+ end
31
+ @(posedge aclk);
32
+ a2b = $realtime;
33
+ @(posedge bclk);
34
+ a2b = $realtime - a2b;
35
+
36
+ @(posedge bclk);
37
+ b2a = $realtime;
38
+ @(posedge aclk);
39
+ b2a = $realtime - b2a;
40
+ @(posedge aclk);
41
+ if(a2b < (b2a + 0.001) || a2b > (b2a - 0.001))
42
+ same = 1;
43
+ else same = 0;
44
+
45
+ repeat(10)begin
46
+ @(posedge aclk);
47
+ @(posedge bclk);
48
+ end
49
+
50
+ done = 1;
51
+ end
52
+
53
+ endmodule