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

Subversion Repositories tcp_socket

[/] [tcp_socket/] [trunk/] [chips2/] [test_suite/] [real_main.v] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 jondawson
//name : real_main
2
//tag : c components
3
//source_file : test.c
4
///=========
5
///
6
///*Created by C2CHIP*
7
 
8
// Register Allocation
9
// ===================
10
//         Register                 Name                   Size          
11
//            0             real_main return address            2            
12
 
13
`timescale 1ns/1ps
14
module real_main;
15
  integer file_count;
16
  reg       [15:0] timer;
17
  reg       [1:0] program_counter;
18
  reg       [15:0] address_2;
19
  reg       [15:0] data_out_2;
20
  reg       [15:0] data_in_2;
21
  reg       write_enable_2;
22
  reg       [15:0] address_4;
23
  reg       [31:0] data_out_4;
24
  reg       [31:0] data_in_4;
25
  reg       write_enable_4;
26
  reg       [15:0] register_0;
27
  reg       clk;
28
  reg       rst;
29
 
30
  //////////////////////////////////////////////////////////////////////////////
31
  // CLOCK AND RESET GENERATION                                                 
32
  //                                                                            
33
  // This file was generated in test bench mode. In this mode, the verilog      
34
  // output file can be executed directly within a verilog simulator.           
35
  // In test bench mode, a simulated clock and reset signal are generated within
36
  // the output file.                                                           
37
  // Verilog files generated in testbecnch mode are not suitable for synthesis, 
38
  // or for instantiation within a larger design.
39
 
40
  initial
41
  begin
42
    rst <= 1'b1;
43
    #50 rst <= 1'b0;
44
  end
45
 
46
 
47
  initial
48
  begin
49
    clk <= 1'b0;
50
    while (1) begin
51
      #5 clk <= ~clk;
52
    end
53
  end
54
 
55
 
56
  //////////////////////////////////////////////////////////////////////////////
57
  // FSM IMPLEMENTAION OF C PROCESS                                             
58
  //                                                                            
59
  // This section of the file contains a Finite State Machine (FSM) implementing
60
  // the C process. In general execution is sequential, but the compiler will   
61
  // attempt to execute instructions in parallel if the instruction dependencies
62
  // allow. Further concurrency can be achieved by executing multiple C         
63
  // processes concurrently within the device.                                  
64
 
65
  always @(posedge clk)
66
  begin
67
 
68
    //implement timer
69
    timer <= 16'h0000;
70
 
71
    case(program_counter)
72
 
73
      16'd0:
74
      begin
75
        program_counter <= 16'd1;
76
        program_counter <= 16'd3;
77
        register_0 <= 16'd1;
78
      end
79
 
80
      16'd1:
81
      begin
82
        program_counter <= 16'd3;
83
        $finish;
84
        program_counter <= program_counter;
85
      end
86
 
87
      16'd3:
88
      begin
89
        program_counter <= 16'd2;
90
        program_counter <= register_0;
91
      end
92
 
93
    endcase
94
    if (rst == 1'b1) begin
95
      program_counter <= 0;
96
    end
97
  end
98
 
99
endmodule

powered by: WebSVN 2.1.0

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