~ubuntu-branches/ubuntu/saucy/verilator/saucy-proposed

« back to all changes in this revision

Viewing changes to test_regress/t/t_inst_array_partial.v

  • Committer: Package Import Robot
  • Author(s): أحمد المحمودي (Ahmed El-Mahmoudy)
  • Date: 2013-02-10 17:14:43 UTC
  • mfrom: (1.2.17)
  • Revision ID: package-import@ubuntu.com-20130210171443-58ibaqe3eq5uitns
Tags: 3.845-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
   );
10
10
   input clk;
11
11
 
12
 
   wire [17:10] bitout;
13
 
   wire [27:24] short_bitout;
 
12
   wire [19:10] bitout;
 
13
   wire [29:24] short_bitout;
14
14
   wire [7:0]   allbits;
15
15
   wire [15:0]  twobits;
16
16
 
37
37
                   .twobits (twobits),
38
38
                   .bitout (bitout[17:10]));
39
39
 
 
40
   sub
 
41
     i_sub6 [7:4] (.allbits (allbits),
 
42
                   .twobits (twobits[15:8]),
 
43
                   .bitout ({bitout[18+:2],short_bitout[28+:2]}));
 
44
 
40
45
   integer      cyc=0;
41
46
   reg [63:0]   crc;
42
47
   reg [63:0]   sum;
44
49
   // Signals under test
45
50
   assign allbits = crc[7:0];
46
51
   assign twobits = crc[15:0];
47
 
   wire [63:0] result = {52'h0, short_bitout, bitout};
 
52
   wire [63:0] result = {48'h0, short_bitout, bitout};
48
53
 
49
54
   // Test loop
50
55
   always @ (posedge clk) begin
68
73
         $write("[%0t] cyc==%0d crc=%x sum=%x\n",$time, cyc, crc, sum);
69
74
         if (crc !== 64'hc77bb9b3784ea091) $stop;
70
75
         // What checksum will we end up with (above print should match)
71
 
`define EXPECTED_SUM 64'h0bf9559ce1f98425
 
76
`define EXPECTED_SUM 64'ha1da9ff8082a4ff6
72
77
         if (sum !== `EXPECTED_SUM) $stop;
73
78
         $write("*-* All Finished *-*\n");
74
79
         $finish;