OpenCores
URL https://opencores.org/ocsvn/minsoc/minsoc/trunk

Subversion Repositories minsoc

[/] [minsoc/] [branches/] [verilator/] [bench/] [verilog/] [minsoc_bench_core.v] - Blame information for rev 125

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 rfajardo
`include "minsoc_bench_defines.v"
2
`include "minsoc_defines.v"
3 10 rfajardo
`include "or1200_defines.v"
4 2 rfajardo
 
5 71 rfajardo
`include "timescale.v"
6
 
7 2 rfajardo
module minsoc_bench();
8
 
9 60 rfajardo
`ifdef POSITIVE_RESET
10
    localparam RESET_LEVEL = 1'b1;
11
`elsif NEGATIVE_RESET
12
    localparam RESET_LEVEL = 1'b0;
13
`else
14
    localparam RESET_LEVEL = 1'b1;
15
`endif
16
 
17 2 rfajardo
reg clock, reset;
18
 
19 17 rfajardo
//Debug interface
20 2 rfajardo
wire dbg_tms_i;
21
wire dbg_tck_i;
22
wire dbg_tdi_i;
23
wire dbg_tdo_o;
24
wire jtag_vref;
25
wire jtag_gnd;
26
 
27 17 rfajardo
//SPI wires
28 2 rfajardo
wire spi_mosi;
29
reg spi_miso;
30
wire spi_sclk;
31
wire [1:0] spi_ss;
32
 
33 17 rfajardo
//UART wires
34 2 rfajardo
wire uart_stx;
35 9 rfajardo
reg uart_srx;
36 2 rfajardo
 
37 17 rfajardo
//ETH wires
38
reg eth_col;
39
reg eth_crs;
40 2 rfajardo
wire eth_trst;
41 17 rfajardo
reg eth_tx_clk;
42 2 rfajardo
wire eth_tx_en;
43
wire eth_tx_er;
44
wire [3:0] eth_txd;
45 17 rfajardo
reg eth_rx_clk;
46
reg eth_rx_dv;
47
reg eth_rx_er;
48
reg [3:0] eth_rxd;
49
reg eth_fds_mdint;
50 2 rfajardo
wire eth_mdc;
51
wire eth_mdio;
52
 
53
//
54
//      TASKS registers to communicate with interfaces
55
//
56 124 rfajardo
reg design_ready;
57
reg uart_echo;
58
`ifdef UART
59
reg [40*8-1:0] line;
60
reg [12*8-1:0] hello;
61
reg new_line;
62
reg new_char;
63
`endif
64 17 rfajardo
`ifdef ETHERNET
65 28 rfajardo
reg [7:0] eth_rx_data [0:1535];            //receive buffer ETH (max packet 1536)
66 17 rfajardo
reg [7:0] eth_tx_data [0:1535];     //send buffer ETH (max packet 1536)
67
localparam ETH_HDR = 14;
68
localparam ETH_PAYLOAD_MAX_LENGTH = 1518;//only able to send up to 1536 bytes with header (14 bytes) and CRC (4 bytes)
69
`endif
70 2 rfajardo
 
71
 
72
//
73
// Testbench mechanics
74
//
75 4 rfajardo
reg [7:0] program_mem[(1<<(`MEMORY_ADR_WIDTH+2))-1:0];
76 123 rfajardo
integer initialize, firmware_size, ptr;
77 2 rfajardo
reg [8*64:0] file_name;
78
reg load_file;
79 8 rfajardo
 
80 2 rfajardo
initial begin
81 60 rfajardo
    reset = ~RESET_LEVEL;
82 8 rfajardo
    clock = 1'b0;
83 124 rfajardo
    design_ready = 1'b0;
84
    uart_echo = 1'b1;
85 28 rfajardo
 
86
`ifndef NO_CLOCK_DIVISION
87
    minsoc_top_0.clk_adjust.clk_int = 1'b0;
88
    minsoc_top_0.clk_adjust.clock_divisor = 32'h0000_0000;
89
`endif
90 17 rfajardo
 
91 11 rfajardo
    uart_srx = 1'b1;
92 17 rfajardo
 
93
        eth_col = 1'b0;
94
        eth_crs = 1'b0;
95
        eth_fds_mdint = 1'b1;
96
        eth_rx_er = 1'b0;
97
 
98
        eth_tx_clk = 1'b0;
99
        eth_rx_clk = 1'b0;
100
        eth_rxd = 4'h0;
101
        eth_rx_dv = 1'b0;
102
 
103 8 rfajardo
 
104 17 rfajardo
//dual and two port rams from FPGA memory instances have to be initialized to 0
105 10 rfajardo
    init_fpga_memory();
106
 
107 2 rfajardo
        load_file = 1'b0;
108
`ifdef INITIALIZE_MEMORY_MODEL
109
        load_file = 1'b1;
110
`endif
111
`ifdef START_UP
112
        load_file = 1'b1;
113
`endif
114 8 rfajardo
 
115 2 rfajardo
        //get firmware hex file from command line input
116
        if ( load_file ) begin
117
                if ( ! $value$plusargs("file_name=%s", file_name) || file_name == 0 ) begin
118
                        $display("ERROR: please specify an input file to start.");
119
                        $finish;
120
                end
121
                $readmemh(file_name, program_mem);
122
                // First word comprehends size of program
123 123 rfajardo
                firmware_size = { program_mem[0] , program_mem[1] , program_mem[2] , program_mem[3] };
124 2 rfajardo
        end
125
 
126
`ifdef INITIALIZE_MEMORY_MODEL
127
        // Initialize memory with firmware
128
        initialize = 0;
129 123 rfajardo
        while ( initialize < firmware_size ) begin
130 2 rfajardo
                minsoc_top_0.onchip_ram_top.block_ram_3.mem[initialize/4] = program_mem[initialize];
131
                minsoc_top_0.onchip_ram_top.block_ram_2.mem[initialize/4] = program_mem[initialize+1];
132
                minsoc_top_0.onchip_ram_top.block_ram_1.mem[initialize/4] = program_mem[initialize+2];
133
                minsoc_top_0.onchip_ram_top.block_ram_0.mem[initialize/4] = program_mem[initialize+3];
134
        initialize = initialize + 4;
135
        end
136
        $display("Memory model initialized with firmware:");
137
        $display("%s", file_name);
138 123 rfajardo
        $display("%d Bytes loaded from %d ...", initialize , firmware_size);
139 2 rfajardo
`endif
140
 
141
    // Reset controller
142
    repeat (2) @ (negedge clock);
143 60 rfajardo
    reset = RESET_LEVEL;
144 2 rfajardo
    repeat (16) @ (negedge clock);
145 60 rfajardo
    reset = ~RESET_LEVEL;
146 2 rfajardo
 
147
`ifdef START_UP
148
        // Pass firmware over spi to or1k_startup
149
        ptr = 0;
150
        //read dummy
151
        send_spi(program_mem[ptr]);
152
        send_spi(program_mem[ptr]);
153
        send_spi(program_mem[ptr]);
154
        send_spi(program_mem[ptr]);
155
        //~read dummy
156 123 rfajardo
        while ( ptr < firmware_size ) begin
157 2 rfajardo
                send_spi(program_mem[ptr]);
158
                ptr = ptr + 1;
159
        end
160
        $display("Memory start-up completed...");
161
        $display("Loaded firmware:");
162
        $display("%s", file_name);
163
`endif
164 17 rfajardo
 
165
 
166 2 rfajardo
        //
167
    // Testbench START
168
        //
169 124 rfajardo
    design_ready = 1'b1;
170 125 rfajardo
    $display("Running simulation: if you want to stop it, type ctrl+c and type in finish afterwards.");
171 17 rfajardo
    fork
172
        begin
173 125 rfajardo
`ifdef UART
174 124 rfajardo
 
175 125 rfajardo
`ifdef ETHERNET
176
`ifdef TEST_ETHERNET
177
            $display("Testing Ethernet firmware, this takes long (~30 min. @ 2.53 GHz dual-core)...");
178
            $display("Ethernet firmware encloses UART firmware, testing UART firmware first...");
179
            test_uart();
180
            test_eth();
181 124 rfajardo
            $display("Stopping simulation.");
182
            $finish;
183 125 rfajardo
`endif
184
`endif
185
 
186
`ifdef TEST_UART
187
            $display("Testing UART firmware, this takes a while (~1 min. @ 2.53 GHz dual-core)...");
188
            test_uart();
189 124 rfajardo
            $display("Stopping simulation.");
190
            $finish;
191 125 rfajardo
`endif
192
 
193 124 rfajardo
`endif
194 17 rfajardo
        end
195 124 rfajardo
        begin
196 125 rfajardo
`ifdef ETHERNET
197 124 rfajardo
`ifdef TEST_ETHERNET
198
            get_mac();
199
            if ( { eth_rx_data[ETH_HDR] , eth_rx_data[ETH_HDR+1] , eth_rx_data[ETH_HDR+2] , eth_rx_data[ETH_HDR+3] } == 32'hFF2B4050 )
200
                $display("Ethernet firmware started correctly.");
201
`endif
202 125 rfajardo
`endif
203 124 rfajardo
        end
204 17 rfajardo
    join
205 2 rfajardo
 
206
end
207
 
208
 
209
//
210
// Modules instantiations
211
//
212
minsoc_top minsoc_top_0(
213
   .clk(clock),
214
   .reset(reset)
215
 
216
   //JTAG ports
217
`ifdef GENERIC_TAP
218
   , .jtag_tdi(dbg_tdi_i),
219
   .jtag_tms(dbg_tms_i),
220
   .jtag_tck(dbg_tck_i),
221
   .jtag_tdo(dbg_tdo_o),
222
   .jtag_vref(jtag_vref),
223
   .jtag_gnd(jtag_gnd)
224
`endif
225
 
226
   //SPI ports
227
`ifdef START_UP
228
   , .spi_flash_mosi(spi_mosi),
229
   .spi_flash_miso(spi_miso),
230
   .spi_flash_sclk(spi_sclk),
231
   .spi_flash_ss(spi_ss)
232
`endif
233
 
234
   //UART ports
235
`ifdef UART
236
   , .uart_stx(uart_stx),
237
   .uart_srx(uart_srx)
238
`endif // !UART
239
 
240
        // Ethernet ports
241
`ifdef ETHERNET
242
        , .eth_col(eth_col),
243
    .eth_crs(eth_crs),
244
    .eth_trste(eth_trst),
245
    .eth_tx_clk(eth_tx_clk),
246
        .eth_tx_en(eth_tx_en),
247
    .eth_tx_er(eth_tx_er),
248
    .eth_txd(eth_txd),
249
    .eth_rx_clk(eth_rx_clk),
250
        .eth_rx_dv(eth_rx_dv),
251
    .eth_rx_er(eth_rx_er),
252
    .eth_rxd(eth_rxd),
253
    .eth_fds_mdint(eth_fds_mdint),
254
        .eth_mdc(eth_mdc),
255
    .eth_mdio(eth_mdio)
256
`endif // !ETHERNET
257
);
258
 
259
`ifdef VPI_DEBUG
260
        dbg_comm_vpi dbg_if(
261
                .SYS_CLK(clock),
262
                .P_TMS(dbg_tms_i),
263
                .P_TCK(dbg_tck_i),
264
                .P_TRST(),
265
                .P_TDI(dbg_tdi_i),
266
                .P_TDO(dbg_tdo_o)
267
        );
268
`else
269
   assign dbg_tdi_i = 1;
270
   assign dbg_tck_i = 0;
271
   assign dbg_tms_i = 1;
272
`endif
273
 
274
 
275
//
276 125 rfajardo
// Firmware testers
277
//
278
task test_uart();
279
    begin
280
            @ (posedge new_line);
281
            $display("UART data received.");
282
            hello = line[12*8-1:0];
283
            //sending character A to UART, B expected
284
            $display("Testing UART interrupt...");
285
            uart_echo = 1'b0;
286
            uart_send(8'h41);       //Character A
287
            @ (posedge new_char);
288
            if ( line[7:0] == "B" )
289
                $display("UART interrupt working.");
290
            else
291
                $display("UART interrupt failed.");
292
            uart_echo = 1'b1;
293
 
294
            if ( hello == "Hello World." )
295
                $display("UART firmware test completed, behaving correclty.");
296
            else
297
                $display("UART firmware test completed, failed.");
298
    end
299
endtask
300
 
301
task test_eth();
302
    begin
303
                eth_tx_data[ETH_HDR+0] = 8'hBA;
304
                eth_tx_data[ETH_HDR+1] = 8'h87;
305
                eth_tx_data[ETH_HDR+2] = 8'hAA;
306
                eth_tx_data[ETH_HDR+3] = 8'hBB;
307
                eth_tx_data[ETH_HDR+4] = 8'hCC;
308
                eth_tx_data[ETH_HDR+5] = 8'hDD;
309
 
310
            $display("Sending an Ethernet package to the system and waiting for the data to be output through UART...");
311
                send_mac(6);
312
            $display("This takes a long time, if you want to stop it, type ctrl+c and type in finish afterwards.");
313
            repeat(3+40) @ (posedge new_line);
314
            $display("Ethernet test completed.");
315
    end
316
endtask
317
 
318
 
319
//
320 8 rfajardo
//      Regular clocking and output
321 2 rfajardo
//
322
always begin
323
    #((`CLK_PERIOD)/2) clock <= ~clock;
324
end
325
 
326
`ifdef VCD_OUTPUT
327
initial begin
328
        $dumpfile("../results/minsoc_wave.vcd");
329
        $dumpvars();
330
end
331
`endif
332
 
333
 
334
//
335
//      Functionalities tasks: SPI Startup and UART Monitor
336
//
337
//SPI START_UP
338
`ifdef START_UP
339 28 rfajardo
task send_spi;
340
    input [7:0] data_in;
341
    integer i;
342 2 rfajardo
    begin
343 28 rfajardo
        i = 7;
344
        for ( i = 7 ; i >= 0; i = i - 1 ) begin
345 2 rfajardo
                spi_miso = data_in[i];
346 28 rfajardo
                        @ (posedge spi_sclk);
347
            end
348
    end
349 2 rfajardo
endtask
350
`endif
351
//~SPI START_UP
352
 
353 17 rfajardo
//UART
354 2 rfajardo
`ifdef UART
355 124 rfajardo
localparam UART_TX_WAIT = (`FREQ / `UART_BAUDRATE);
356 2 rfajardo
 
357 17 rfajardo
task uart_send;
358
    input [7:0] data;
359
    integer i;
360
    begin
361
        uart_srx = 1'b0;
362 124 rfajardo
        repeat (UART_TX_WAIT) @ (posedge clock);
363 17 rfajardo
        for ( i = 0; i < 8 ; i = i + 1 ) begin
364
                    uart_srx = data[i];
365 124 rfajardo
            repeat (UART_TX_WAIT) @ (posedge clock);
366 17 rfajardo
            end
367
        uart_srx = 1'b0;
368 124 rfajardo
        repeat (UART_TX_WAIT) @ (posedge clock);
369 17 rfajardo
            uart_srx = 1'b1;
370
    end
371
endtask
372
 
373
//UART Monitor (prints uart output on the terminal)
374 2 rfajardo
// Something to trigger the task
375 124 rfajardo
initial
376
begin
377
    new_line = 1'b0;
378
    new_char = 1'b0;
379
end
380 2 rfajardo
 
381 124 rfajardo
always @ (posedge clock)
382
    if ( design_ready )
383
        uart_decoder;
384
 
385 2 rfajardo
task uart_decoder;
386
        integer i;
387
        reg [7:0] tx_byte;
388
        begin
389 124 rfajardo
        new_char = 1'b0;
390
        // Wait for start bit
391
        while (uart_stx == 1'b1)
392
        @(uart_stx);
393 2 rfajardo
 
394 124 rfajardo
        repeat (UART_TX_WAIT+(UART_TX_WAIT/2)) @ (posedge clock);
395 2 rfajardo
 
396 124 rfajardo
        for ( i = 0; i < 8 ; i = i + 1 ) begin
397
            tx_byte[i] = uart_stx;
398
            repeat (UART_TX_WAIT) @ (posedge clock);
399
        end
400 2 rfajardo
 
401 124 rfajardo
        //Check for stop bit
402
        if (uart_stx == 1'b0) begin
403
            //$display("* WARNING: user stop bit not received when expected at time %d__", $time);
404
            // Wait for return to idle
405
            while (uart_stx == 1'b0)
406
            @(uart_stx);
407
            //$display("* USER UART returned to idle at time %d",$time);
408
        end
409
        // display the char
410
        new_char = 1'b1;
411
        if ( uart_echo )
412
            $write("%c", tx_byte);
413
        if ( new_line )
414
            line = "";
415
        if ( tx_byte == "\n" )
416
            new_line = 1'b1;
417
        else begin
418
            line = { line[39*8-1:0], tx_byte};
419
            new_line = 1'b0;
420
        end
421
    end
422 2 rfajardo
endtask
423 17 rfajardo
//~UART Monitor
424 2 rfajardo
`endif // !UART
425 17 rfajardo
//~UART
426 2 rfajardo
 
427
 
428
//
429
//      TASKS to communicate with interfaces
430
//
431 28 rfajardo
//MAC_DATA
432 2 rfajardo
//
433 28 rfajardo
`ifdef ETHERNET
434 17 rfajardo
reg [31:0] crc32_result;
435 28 rfajardo
 
436
task get_mac;
437
    integer conta;
438
    reg LSB;
439
    begin
440
        conta = 0;
441
        LSB = 1;
442 17 rfajardo
        @ ( posedge eth_tx_en);
443
 
444
        repeat (16) @ (negedge eth_tx_clk);  //8 bytes, preamble (7 bytes) + start of frame (1 byte)
445 28 rfajardo
 
446
        while ( eth_tx_en == 1'b1 ) begin
447
            @ (negedge eth_tx_clk) begin
448
                if ( LSB == 1'b1 )
449
                    eth_rx_data[conta][3:0] = eth_txd;
450
                else begin
451
                    eth_rx_data[conta][7:4] = eth_txd;
452
                    conta = conta + 1;
453
                end
454
                LSB = ~LSB;
455
            end
456
        end
457
    end
458
endtask
459
 
460 17 rfajardo
task send_mac;              //only able to send up to 1536 bytes with header (14 bytes) and CRC (4 bytes)
461 28 rfajardo
    input [31:0] length;    //ETH_PAYLOAD_MAX_LENGTH 1518
462
    integer conta;
463 17 rfajardo
    begin
464 28 rfajardo
        if ( length <= ETH_PAYLOAD_MAX_LENGTH ) begin
465
            //DEST MAC
466
            eth_tx_data[0] = 8'h55;
467
            eth_tx_data[1] = 8'h47;
468
            eth_tx_data[2] = 8'h34;
469
            eth_tx_data[3] = 8'h22;
470
            eth_tx_data[4] = 8'h88;
471
            eth_tx_data[5] = 8'h92;
472
 
473
            //SOURCE MAC
474
            eth_tx_data[6] = 8'h3D;
475
            eth_tx_data[7] = 8'h4F;
476
            eth_tx_data[8] = 8'h1A;
477
            eth_tx_data[9] = 8'hBE;
478
            eth_tx_data[10] = 8'h68;
479
            eth_tx_data[11] = 8'h72;
480
 
481
            //LEN
482
            eth_tx_data[12] = length[7:4];
483
            eth_tx_data[13] = length[3:0];
484
 
485
            //DATA input by task caller
486
 
487
            //PAD
488
            for ( conta = length+14; conta < 60; conta = conta + 1 ) begin
489
                eth_tx_data[conta] = 8'h00;
490
            end
491
 
492
            gencrc32(conta);
493
 
494
            eth_tx_data[conta] = crc32_result[31:24];
495
            eth_tx_data[conta+1] = crc32_result[23:16];
496
            eth_tx_data[conta+2] = crc32_result[15:8];
497
            eth_tx_data[conta+3] = crc32_result[7:0];
498
 
499 17 rfajardo
            send_rx_packet( 64'h0055_5555_5555_5555, 4'h7, 8'hD5, 32'h0000_0000, conta+4, 1'b0 );
500
        end
501
        else
502 28 rfajardo
            $display("Warning: Ethernet packet is to big to be sent.");
503
    end
504 17 rfajardo
 
505 28 rfajardo
endtask
506
 
507 17 rfajardo
task send_rx_packet;
508
  input  [(8*8)-1:0] preamble_data; // preamble data to be sent - correct is 64'h0055_5555_5555_5555
509
  input   [3:0] preamble_len; // length of preamble in bytes - max is 4'h8, correct is 4'h7 
510
  input   [7:0] sfd_data; // SFD data to be sent - correct is 8'hD5
511
  input  [31:0] start_addr; // start address
512
  input  [31:0] len; // length of frame in Bytes (without preamble and SFD)
513
  input         plus_drible_nibble; // if length is longer for one nibble
514
  integer       rx_cnt;
515
  reg    [31:0] eth_tx_data_addr_in; // address for reading from RX memory       
516
  reg     [7:0] eth_tx_data_data_out; // data for reading from RX memory
517
begin
518
      @(posedge eth_rx_clk);
519 124 rfajardo
       eth_rx_dv = 1;
520 17 rfajardo
 
521
      // set initial rx memory address
522
      eth_tx_data_addr_in = start_addr;
523
 
524
      // send preamble
525
      for (rx_cnt = 0; (rx_cnt < (preamble_len << 1)) && (rx_cnt < 16); rx_cnt = rx_cnt + 1)
526
      begin
527 124 rfajardo
         eth_rxd = preamble_data[3:0];
528
         preamble_data = preamble_data >> 4;
529 17 rfajardo
        @(posedge eth_rx_clk);
530
      end
531
 
532
      // send SFD
533
      for (rx_cnt = 0; rx_cnt < 2; rx_cnt = rx_cnt + 1)
534
      begin
535 124 rfajardo
         eth_rxd = sfd_data[3:0];
536
         sfd_data = sfd_data >> 4;
537 17 rfajardo
        @(posedge eth_rx_clk);
538
      end
539
 
540
      // send packet's addresses, type/length, data and FCS
541
      for (rx_cnt = 0; rx_cnt < len; rx_cnt = rx_cnt + 1)
542
      begin
543
        eth_tx_data_data_out = eth_tx_data[eth_tx_data_addr_in[21:0]];
544
        eth_rxd = eth_tx_data_data_out[3:0];
545
        @(posedge eth_rx_clk);
546
        eth_rxd = eth_tx_data_data_out[7:4];
547
        eth_tx_data_addr_in = eth_tx_data_addr_in + 1;
548
        @(posedge eth_rx_clk);
549
      end
550
      if (plus_drible_nibble)
551
      begin
552
        eth_tx_data_data_out = eth_tx_data[eth_tx_data_addr_in[21:0]];
553
        eth_rxd = eth_tx_data_data_out[3:0];
554
        @(posedge eth_rx_clk);
555
      end
556
 
557 124 rfajardo
       eth_rx_dv = 0;
558 17 rfajardo
      @(posedge eth_rx_clk);
559
 
560
end
561
endtask // send_rx_packet
562 28 rfajardo
 
563
//CRC32
564
localparam [31:0] CRC32_POLY = 32'h04C11DB7;
565
 
566 17 rfajardo
task gencrc32;
567
    input [31:0] crc32_length;
568 28 rfajardo
 
569
    integer     byte, bit;
570
    reg         msb;
571
    reg [7:0]    current_byte;
572
    reg [31:0]   temp;
573
 
574
    begin
575
        crc32_result = 32'hffffffff;
576
        for (byte = 0; byte < crc32_length; byte = byte + 1) begin
577
            current_byte = eth_tx_data[byte];
578
            for (bit = 0; bit < 8; bit = bit + 1) begin
579
                msb = crc32_result[31];
580
                crc32_result = crc32_result << 1;
581
                if (msb != current_byte[bit]) begin
582
                    crc32_result = crc32_result ^ CRC32_POLY;
583
                    crc32_result[0] = 1;
584
                end
585
            end
586
        end
587
 
588
        // Last step is to "mirror" every bit, swap the 4 bytes, and then complement each bit.
589
        //
590
        // Mirror:
591
        for (bit = 0; bit < 32; bit = bit + 1)
592
            temp[31-bit] = crc32_result[bit];
593
 
594
        // Swap and Complement:
595
        crc32_result = ~{temp[7:0], temp[15:8], temp[23:16], temp[31:24]};
596
    end
597
endtask
598 17 rfajardo
//~CRC32
599
 
600
//Generate tx and rx clocks
601
always begin
602
        #((`ETH_PHY_PERIOD)/2) eth_tx_clk <= ~eth_tx_clk;
603
end
604
always begin
605
        #((`ETH_PHY_PERIOD)/2) eth_rx_clk <= ~eth_rx_clk;
606
end
607
//~Generate tx and rx clocks
608 28 rfajardo
 
609
`endif // !ETHERNET
610 2 rfajardo
//~MAC_DATA
611
 
612
 
613 10 rfajardo
 
614
//
615
// TASK to initialize instantiated FPGA dual and two port memory to 0
616
//
617
task init_fpga_memory;
618
    integer i;
619
    begin
620
`ifdef OR1200_RFRAM_TWOPORT
621
`ifdef OR1200_XILINX_RAMB4
622
    for ( i = 0; i < (1<<8); i = i + 1 ) begin
623
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.ramb4_s16_s16_0.mem[i] = 16'h0000;
624
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.ramb4_s16_s16_1.mem[i] = 16'h0000;
625
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.ramb4_s16_s16_0.mem[i] = 16'h0000;
626
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.ramb4_s16_s16_1.mem[i] = 16'h0000;
627
    end
628
`elsif OR1200_XILINX_RAMB16
629
    for ( i = 0; i < (1<<9); i = i + 1 ) begin
630
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.ramb16_s36_s36.mem[i] = 32'h0000_0000;
631
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.ramb16_s36_s36.mem[i] = 32'h0000_0000;
632
    end
633
`elsif OR1200_ALTERA_LPM
634
`ifndef OR1200_ALTERA_LPM_XXX
635
    $display("Definition OR1200_ALTERA_LPM in or1200_defines.v does not enable ALTERA memory for neither DUAL nor TWO port RFRAM");
636
    $display("It uses GENERIC memory instead.");
637
    $display("Add '`define OR1200_ALTERA_LPM_XXX' under '`define OR1200_ALTERA_LPM' on or1200_defines.v to use ALTERA memory.");
638
`endif
639
`ifdef OR1200_ALTERA_LPM_XXX
640
    $display("...Using ALTERA memory for TWOPORT RFRAM!");
641
    for ( i = 0; i < (1<<5); i = i + 1 ) begin
642
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.altqpram_component.mem[i] = 32'h0000_0000;
643
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.altqpram_component.mem[i] = 32'h0000_0000;
644
    end
645
`else
646
    $display("...Using GENERIC memory!");
647
    for ( i = 0; i < (1<<5); i = i + 1 ) begin
648
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.mem[i] = 32'h0000_0000;
649
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.mem[i] = 32'h0000_0000;
650
    end
651
`endif
652
`elsif OR1200_XILINX_RAM32X1D
653
    $display("Definition OR1200_XILINX_RAM32X1D in or1200_defines.v does not enable FPGA memory for TWO port RFRAM");
654
    $display("It uses GENERIC memory instead.");
655
    $display("FPGA memory can be used if you choose OR1200_RFRAM_DUALPORT");
656
    for ( i = 0; i < (1<<5); i = i + 1 ) begin
657
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.mem[i] = 32'h0000_0000;
658
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.mem[i] = 32'h0000_0000;
659
    end
660
`else
661
    for ( i = 0; i < (1<<5); i = i + 1 ) begin
662
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.mem[i] = 32'h0000_0000;
663
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.mem[i] = 32'h0000_0000;
664
    end
665
`endif
666
`elsif OR1200_RFRAM_DUALPORT
667
`ifdef OR1200_XILINX_RAMB4
668
    for ( i = 0; i < (1<<8); i = i + 1 ) begin
669
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.ramb4_s16_0.mem[i] = 16'h0000;
670
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.ramb4_s16_1.mem[i] = 16'h0000;
671
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.ramb4_s16_0.mem[i] = 16'h0000;
672
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.ramb4_s16_1.mem[i] = 16'h0000;
673
    end
674
`elsif OR1200_XILINX_RAMB16
675
    for ( i = 0; i < (1<<9); i = i + 1 ) begin
676
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.ramb16_s36_s36.mem[i] = 32'h0000_0000;
677
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.ramb16_s36_s36.mem[i] = 32'h0000_0000;
678
    end
679
`elsif OR1200_ALTERA_LPM
680
`ifndef OR1200_ALTERA_LPM_XXX
681
    $display("Definition OR1200_ALTERA_LPM in or1200_defines.v does not enable ALTERA memory for neither DUAL nor TWO port RFRAM");
682
    $display("It uses GENERIC memory instead.");
683
    $display("Add '`define OR1200_ALTERA_LPM_XXX' under '`define OR1200_ALTERA_LPM' on or1200_defines.v to use ALTERA memory.");
684
`endif
685
`ifdef OR1200_ALTERA_LPM_XXX
686
    $display("...Using ALTERA memory for DUALPORT RFRAM!");
687
    for ( i = 0; i < (1<<5); i = i + 1 ) begin
688
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.altqpram_component.mem[i] = 32'h0000_0000;
689
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.altqpram_component.mem[i] = 32'h0000_0000;
690
    end
691
`else
692
    $display("...Using GENERIC memory!");
693
    for ( i = 0; i < (1<<5); i = i + 1 ) begin
694
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.mem[i] = 32'h0000_0000;
695
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.mem[i] = 32'h0000_0000;
696
    end
697
`endif
698
`elsif OR1200_XILINX_RAM32X1D
699
`ifdef OR1200_USE_RAM16X1D_FOR_RAM32X1D
700
    for ( i = 0; i < (1<<4); i = i + 1 ) begin
701
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_0.ram32x1d_0_0.mem[i] = 1'b0;
702
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_0.ram32x1d_0_1.mem[i] = 1'b0;
703
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_0.ram32x1d_0_2.mem[i] = 1'b0;
704
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_0.ram32x1d_0_3.mem[i] = 1'b0;
705
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_0.ram32x1d_0_4.mem[i] = 1'b0;
706
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_0.ram32x1d_0_5.mem[i] = 1'b0;
707
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_0.ram32x1d_0_6.mem[i] = 1'b0;
708
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_0.ram32x1d_0_7.mem[i] = 1'b0;
709
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_0.ram32x1d_1_0.mem[i] = 1'b0;
710
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_0.ram32x1d_1_1.mem[i] = 1'b0;
711
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_0.ram32x1d_1_2.mem[i] = 1'b0;
712
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_0.ram32x1d_1_3.mem[i] = 1'b0;
713
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_0.ram32x1d_1_4.mem[i] = 1'b0;
714
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_0.ram32x1d_1_5.mem[i] = 1'b0;
715
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_0.ram32x1d_1_6.mem[i] = 1'b0;
716
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_0.ram32x1d_1_7.mem[i] = 1'b0;
717
 
718
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_1.ram32x1d_0_0.mem[i] = 1'b0;
719
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_1.ram32x1d_0_1.mem[i] = 1'b0;
720
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_1.ram32x1d_0_2.mem[i] = 1'b0;
721
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_1.ram32x1d_0_3.mem[i] = 1'b0;
722
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_1.ram32x1d_0_4.mem[i] = 1'b0;
723
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_1.ram32x1d_0_5.mem[i] = 1'b0;
724
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_1.ram32x1d_0_6.mem[i] = 1'b0;
725
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_1.ram32x1d_0_7.mem[i] = 1'b0;
726
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_1.ram32x1d_1_0.mem[i] = 1'b0;
727
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_1.ram32x1d_1_1.mem[i] = 1'b0;
728
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_1.ram32x1d_1_2.mem[i] = 1'b0;
729
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_1.ram32x1d_1_3.mem[i] = 1'b0;
730
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_1.ram32x1d_1_4.mem[i] = 1'b0;
731
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_1.ram32x1d_1_5.mem[i] = 1'b0;
732
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_1.ram32x1d_1_6.mem[i] = 1'b0;
733
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_1.ram32x1d_1_7.mem[i] = 1'b0;
734
 
735
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_2.ram32x1d_0_0.mem[i] = 1'b0;
736
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_2.ram32x1d_0_1.mem[i] = 1'b0;
737
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_2.ram32x1d_0_2.mem[i] = 1'b0;
738
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_2.ram32x1d_0_3.mem[i] = 1'b0;
739
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_2.ram32x1d_0_4.mem[i] = 1'b0;
740
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_2.ram32x1d_0_5.mem[i] = 1'b0;
741
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_2.ram32x1d_0_6.mem[i] = 1'b0;
742
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_2.ram32x1d_0_7.mem[i] = 1'b0;
743
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_2.ram32x1d_1_0.mem[i] = 1'b0;
744
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_2.ram32x1d_1_1.mem[i] = 1'b0;
745
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_2.ram32x1d_1_2.mem[i] = 1'b0;
746
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_2.ram32x1d_1_3.mem[i] = 1'b0;
747
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_2.ram32x1d_1_4.mem[i] = 1'b0;
748
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_2.ram32x1d_1_5.mem[i] = 1'b0;
749
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_2.ram32x1d_1_6.mem[i] = 1'b0;
750
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_2.ram32x1d_1_7.mem[i] = 1'b0;
751
 
752
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_3.ram32x1d_0_0.mem[i] = 1'b0;
753
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_3.ram32x1d_0_1.mem[i] = 1'b0;
754
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_3.ram32x1d_0_2.mem[i] = 1'b0;
755
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_3.ram32x1d_0_3.mem[i] = 1'b0;
756
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_3.ram32x1d_0_4.mem[i] = 1'b0;
757
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_3.ram32x1d_0_5.mem[i] = 1'b0;
758
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_3.ram32x1d_0_6.mem[i] = 1'b0;
759
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_3.ram32x1d_0_7.mem[i] = 1'b0;
760
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_3.ram32x1d_1_0.mem[i] = 1'b0;
761
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_3.ram32x1d_1_1.mem[i] = 1'b0;
762
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_3.ram32x1d_1_2.mem[i] = 1'b0;
763
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_3.ram32x1d_1_3.mem[i] = 1'b0;
764
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_3.ram32x1d_1_4.mem[i] = 1'b0;
765
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_3.ram32x1d_1_5.mem[i] = 1'b0;
766
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_3.ram32x1d_1_6.mem[i] = 1'b0;
767
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_3.ram32x1d_1_7.mem[i] = 1'b0;
768
 
769
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_0.ram32x1d_0_0.mem[i] = 1'b0;
770
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_0.ram32x1d_0_1.mem[i] = 1'b0;
771
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_0.ram32x1d_0_2.mem[i] = 1'b0;
772
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_0.ram32x1d_0_3.mem[i] = 1'b0;
773
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_0.ram32x1d_0_4.mem[i] = 1'b0;
774
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_0.ram32x1d_0_5.mem[i] = 1'b0;
775
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_0.ram32x1d_0_6.mem[i] = 1'b0;
776
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_0.ram32x1d_0_7.mem[i] = 1'b0;
777
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_0.ram32x1d_1_0.mem[i] = 1'b0;
778
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_0.ram32x1d_1_1.mem[i] = 1'b0;
779
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_0.ram32x1d_1_2.mem[i] = 1'b0;
780
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_0.ram32x1d_1_3.mem[i] = 1'b0;
781
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_0.ram32x1d_1_4.mem[i] = 1'b0;
782
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_0.ram32x1d_1_5.mem[i] = 1'b0;
783
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_0.ram32x1d_1_6.mem[i] = 1'b0;
784
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_0.ram32x1d_1_7.mem[i] = 1'b0;
785
 
786
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_1.ram32x1d_0_0.mem[i] = 1'b0;
787
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_1.ram32x1d_0_1.mem[i] = 1'b0;
788
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_1.ram32x1d_0_2.mem[i] = 1'b0;
789
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_1.ram32x1d_0_3.mem[i] = 1'b0;
790
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_1.ram32x1d_0_4.mem[i] = 1'b0;
791
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_1.ram32x1d_0_5.mem[i] = 1'b0;
792
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_1.ram32x1d_0_6.mem[i] = 1'b0;
793
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_1.ram32x1d_0_7.mem[i] = 1'b0;
794
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_1.ram32x1d_1_0.mem[i] = 1'b0;
795
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_1.ram32x1d_1_1.mem[i] = 1'b0;
796
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_1.ram32x1d_1_2.mem[i] = 1'b0;
797
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_1.ram32x1d_1_3.mem[i] = 1'b0;
798
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_1.ram32x1d_1_4.mem[i] = 1'b0;
799
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_1.ram32x1d_1_5.mem[i] = 1'b0;
800
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_1.ram32x1d_1_6.mem[i] = 1'b0;
801
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_1.ram32x1d_1_7.mem[i] = 1'b0;
802
 
803
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_2.ram32x1d_0_0.mem[i] = 1'b0;
804
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_2.ram32x1d_0_1.mem[i] = 1'b0;
805
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_2.ram32x1d_0_2.mem[i] = 1'b0;
806
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_2.ram32x1d_0_3.mem[i] = 1'b0;
807
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_2.ram32x1d_0_4.mem[i] = 1'b0;
808
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_2.ram32x1d_0_5.mem[i] = 1'b0;
809
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_2.ram32x1d_0_6.mem[i] = 1'b0;
810
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_2.ram32x1d_0_7.mem[i] = 1'b0;
811
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_2.ram32x1d_1_0.mem[i] = 1'b0;
812
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_2.ram32x1d_1_1.mem[i] = 1'b0;
813
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_2.ram32x1d_1_2.mem[i] = 1'b0;
814
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_2.ram32x1d_1_3.mem[i] = 1'b0;
815
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_2.ram32x1d_1_4.mem[i] = 1'b0;
816
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_2.ram32x1d_1_5.mem[i] = 1'b0;
817
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_2.ram32x1d_1_6.mem[i] = 1'b0;
818
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_2.ram32x1d_1_7.mem[i] = 1'b0;
819
 
820
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_3.ram32x1d_0_0.mem[i] = 1'b0;
821
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_3.ram32x1d_0_1.mem[i] = 1'b0;
822
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_3.ram32x1d_0_2.mem[i] = 1'b0;
823
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_3.ram32x1d_0_3.mem[i] = 1'b0;
824
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_3.ram32x1d_0_4.mem[i] = 1'b0;
825
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_3.ram32x1d_0_5.mem[i] = 1'b0;
826
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_3.ram32x1d_0_6.mem[i] = 1'b0;
827
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_3.ram32x1d_0_7.mem[i] = 1'b0;
828
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_3.ram32x1d_1_0.mem[i] = 1'b0;
829
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_3.ram32x1d_1_1.mem[i] = 1'b0;
830
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_3.ram32x1d_1_2.mem[i] = 1'b0;
831
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_3.ram32x1d_1_3.mem[i] = 1'b0;
832
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_3.ram32x1d_1_4.mem[i] = 1'b0;
833
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_3.ram32x1d_1_5.mem[i] = 1'b0;
834
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_3.ram32x1d_1_6.mem[i] = 1'b0;
835
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_3.ram32x1d_1_7.mem[i] = 1'b0;
836
    end
837
`else
838
    for ( i = 0; i < (1<<4); i = i + 1 ) begin
839
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_0.ram32x1d_0.mem[i] = 1'b0;
840
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_0.ram32x1d_1.mem[i] = 1'b0;
841
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_0.ram32x1d_2.mem[i] = 1'b0;
842
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_0.ram32x1d_3.mem[i] = 1'b0;
843
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_0.ram32x1d_4.mem[i] = 1'b0;
844
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_0.ram32x1d_5.mem[i] = 1'b0;
845
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_0.ram32x1d_6.mem[i] = 1'b0;
846
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_0.ram32x1d_7.mem[i] = 1'b0;
847
 
848
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_1.ram32x1d_0.mem[i] = 1'b0;
849
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_1.ram32x1d_1.mem[i] = 1'b0;
850
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_1.ram32x1d_2.mem[i] = 1'b0;
851
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_1.ram32x1d_3.mem[i] = 1'b0;
852
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_1.ram32x1d_4.mem[i] = 1'b0;
853
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_1.ram32x1d_5.mem[i] = 1'b0;
854
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_1.ram32x1d_6.mem[i] = 1'b0;
855
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_1.ram32x1d_7.mem[i] = 1'b0;
856
 
857
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_2.ram32x1d_0.mem[i] = 1'b0;
858
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_2.ram32x1d_1.mem[i] = 1'b0;
859
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_2.ram32x1d_2.mem[i] = 1'b0;
860
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_2.ram32x1d_3.mem[i] = 1'b0;
861
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_2.ram32x1d_4.mem[i] = 1'b0;
862
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_2.ram32x1d_5.mem[i] = 1'b0;
863
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_2.ram32x1d_6.mem[i] = 1'b0;
864
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_2.ram32x1d_7.mem[i] = 1'b0;
865
 
866
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_3.ram32x1d_0.mem[i] = 1'b0;
867
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_3.ram32x1d_1.mem[i] = 1'b0;
868
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_3.ram32x1d_2.mem[i] = 1'b0;
869
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_3.ram32x1d_3.mem[i] = 1'b0;
870
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_3.ram32x1d_4.mem[i] = 1'b0;
871
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_3.ram32x1d_5.mem[i] = 1'b0;
872
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_3.ram32x1d_6.mem[i] = 1'b0;
873
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.xcv_ram32x8d_3.ram32x1d_7.mem[i] = 1'b0;
874
 
875
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_0.ram32x1d_0.mem[i] = 1'b0;
876
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_0.ram32x1d_1.mem[i] = 1'b0;
877
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_0.ram32x1d_2.mem[i] = 1'b0;
878
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_0.ram32x1d_3.mem[i] = 1'b0;
879
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_0.ram32x1d_4.mem[i] = 1'b0;
880
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_0.ram32x1d_5.mem[i] = 1'b0;
881
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_0.ram32x1d_6.mem[i] = 1'b0;
882
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_0.ram32x1d_7.mem[i] = 1'b0;
883
 
884
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_1.ram32x1d_0.mem[i] = 1'b0;
885
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_1.ram32x1d_1.mem[i] = 1'b0;
886
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_1.ram32x1d_2.mem[i] = 1'b0;
887
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_1.ram32x1d_3.mem[i] = 1'b0;
888
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_1.ram32x1d_4.mem[i] = 1'b0;
889
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_1.ram32x1d_5.mem[i] = 1'b0;
890
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_1.ram32x1d_6.mem[i] = 1'b0;
891
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_1.ram32x1d_7.mem[i] = 1'b0;
892
 
893
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_2.ram32x1d_0.mem[i] = 1'b0;
894
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_2.ram32x1d_1.mem[i] = 1'b0;
895
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_2.ram32x1d_2.mem[i] = 1'b0;
896
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_2.ram32x1d_3.mem[i] = 1'b0;
897
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_2.ram32x1d_4.mem[i] = 1'b0;
898
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_2.ram32x1d_5.mem[i] = 1'b0;
899
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_2.ram32x1d_6.mem[i] = 1'b0;
900
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_2.ram32x1d_7.mem[i] = 1'b0;
901
 
902
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_3.ram32x1d_0.mem[i] = 1'b0;
903
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_3.ram32x1d_1.mem[i] = 1'b0;
904
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_3.ram32x1d_2.mem[i] = 1'b0;
905
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_3.ram32x1d_3.mem[i] = 1'b0;
906
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_3.ram32x1d_4.mem[i] = 1'b0;
907
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_3.ram32x1d_5.mem[i] = 1'b0;
908
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_3.ram32x1d_6.mem[i] = 1'b0;
909
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.xcv_ram32x8d_3.ram32x1d_7.mem[i] = 1'b0;
910
    end
911
`endif
912
`else
913
    for ( i = 0; i < (1<<5); i = i + 1 ) begin
914
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_a.mem[i] = 32'h0000_0000;
915
        minsoc_top_0.or1200_top.or1200_cpu.or1200_rf.rf_b.mem[i] = 32'h0000_0000;
916
    end
917
`endif
918
`endif
919
    end
920
endtask
921
 
922
 
923
 
924 2 rfajardo
endmodule
925
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.