~ubuntu-branches/ubuntu/wily/verilator/wily

« back to all changes in this revision

Viewing changes to test_regress/t/t_array_pattern_unpacked.v

  • Committer: Package Import Robot
  • Author(s): أحمد المحمودي (Ahmed El-Mahmoudy)
  • Date: 2014-01-27 10:44:06 UTC
  • mfrom: (1.2.25)
  • Revision ID: package-import@ubuntu.com-20140127104406-s0cbt1mvn7h0169e
Tags: 3.855-1
* New upstream release.
* Refreshed shebang.diff patch.
* debian/copyright: update copyright years

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// DESCRIPTION: Verilator: Verilog Test module
 
2
//
 
3
// This file ONLY is placed into the Public Domain, for any use,
 
4
// without warranty, 2009 by Iztok Jeras.
 
5
 
 
6
module t (/*AUTOARG*/);
 
7
 
 
8
   logic [3:0] array_simp [1:0] [3:0];  // big endian array
 
9
 
 
10
   initial begin
 
11
      array_simp[0] = '{ 4'd3, 4'd2, 4'd1, 4'd0};
 
12
      if ({array_simp[0][3],array_simp[0][2],array_simp[0][1],array_simp[0][0]} !== 16'h3210) $stop;
 
13
 
 
14
      // verilator lint_off WIDTH
 
15
      array_simp[0] = '{ 3 ,2 ,1, 0 };
 
16
      // verilator lint_on WIDTH
 
17
      if ({array_simp[0][3],array_simp[0][2],array_simp[0][1],array_simp[0][0]} !== 16'h3210) $stop;
 
18
 
 
19
      // Doesn't seem to work for unpacked arrays in other simulators
 
20
      //array_simp[0] = '{ 1:4'd3, default:13 };
 
21
      //if ({array_simp[0][3],array_simp[0][2],array_simp[0][1],array_simp[0][0]} !== 16'hDD3D) $stop;
 
22
 
 
23
      array_simp = '{ '{ 4'd3, 4'd2, 4'd1, 4'd0 }, '{ 4'd1, 4'd2, 4'd3, 4'd4 }};
 
24
      if ({array_simp[1][3],array_simp[1][2],array_simp[1][1],array_simp[1][0],
 
25
           array_simp[0][3],array_simp[0][2],array_simp[0][1],array_simp[0][0]} !== 32'h3210_1234) $stop;
 
26
 
 
27
      // Doesn't seem to work for unpacked arrays in other simulators
 
28
      //array_simp <= '{2{ '{4{ 4'd3, 4'd2, 4'd1, 4'd0 }} }};
 
29
 
 
30
      $write("*-* All Finished *-*\n");
 
31
      $finish;
 
32
   end
 
33
 
 
34
endmodule