File: t_mem_multi_io3.v

package info (click to toggle)
verilator 3.864-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 12,272 kB
  • ctags: 19,637
  • sloc: cpp: 57,401; perl: 8,764; yacc: 2,559; lex: 1,727; makefile: 658; sh: 175
file content (52 lines) | stat: -rw-r--r-- 1,581 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// This file ONLY is placed into the Public Domain, for any use,
// without warranty, 2013.

module t
  (
   input logic 				clk,
   input logic 				daten,
   input logic [8:0] 			datval,
   output logic signed [3:0][3:0][35:0] datao
   );

   logic signed [3:0][3:0][3:0][8:0] 	datat;

   genvar 				i;
   generate
      for (i=0; i<4; i++)begin
	 testio dut(.clk(clk), .arr3d_in(datat[i]), .arr2d_out(datao[i]));
      end
   endgenerate

   genvar j;
   generate
      for (i=0; i<4; i++) begin
	 for (j=0; j<4; j++) begin
	    always_comb datat[i][j][0] = daten ? 9'h0 : datval;
	    always_comb datat[i][j][1] = daten ? 9'h1 : datval;
	    always_comb datat[i][j][2] = daten ? 9'h2 : datval;
	    always_comb datat[i][j][3] = daten ? 9'h3 : datval;
	 end
      end
   endgenerate
endmodule

module testio
  (
   input 				clk,
   input logic signed [3:0] [3:0] [8:0] arr3d_in,
   output logic signed [3:0] [35:0] 	arr2d_out
   );
   logic signed [3:0] [35:0] 		ar2d_out_pre;

   always_comb ar2d_out_pre[0][35:0] = {arr3d_in[0][0][8:0], arr3d_in[0][1][8:0], arr3d_in[0][2][8:0], arr3d_in[0][3][8:0]}; 
   always_comb ar2d_out_pre[0][35:0] = {arr3d_in[0][0][8:0], arr3d_in[0][1][8:0], arr3d_in[0][2][8:0], arr3d_in[0][3][8:0]}; 
   always_comb ar2d_out_pre[0][35:0] = {arr3d_in[0][0][8:0], arr3d_in[0][1][8:0], arr3d_in[0][2][8:0], arr3d_in[0][3][8:0]}; 
   always_comb ar2d_out_pre[0][35:0] = {arr3d_in[0][0][8:0], arr3d_in[0][1][8:0], arr3d_in[0][2][8:0], arr3d_in[0][3][8:0]}; 

   always_ff @(posedge clk) begin
      if (clk)
	arr2d_out <= ar2d_out_pre;
   end

endmodule