NCC clean newCell
[fleet.git] / ships / Timer.ship
1 ship: Timer
2
3 == Ports ===========================================================
4 data  out:   out
5
6 == FPGA ==============================================================
7
8   reg [37:0] out_d;
9   assign out_d_ = out_d;
10
11   always @(posedge clk) begin
12
13     if (rst) begin
14       `reset
15       out_d <= 0;
16     end else begin
17       `cleanup
18
19       out_d <= out_d+1;
20
21       if (`out_empty) begin
22          `fill_out
23       end
24
25     end
26   end
27
28 == TeX ==============================================================
29
30 == Fleeterpreter ====================================================
31
32 public void service() {
33     if (!box_out.readyForDataFromShip()) return;
34     box_out.addDataFromShip(System.currentTimeMillis());
35 }
36
37 == FleetSim ==============================================================
38
39 == Constants =========================================================
40
41 == Test ==============================================================
42 #skip
43
44 == Contributors =========================================================
45 Adam Megacz <megacz@cs.berkeley.edu>