adjust ships to use fill/drain/full/empty macros
[fleet.git] / ships / Debug.ship
1 ship: Debug
2
3 == Ports ===========================================================
4 data  in:   in
5
6 == Constants ========================================================
7
8 == TeX ==============================================================
9
10 This ship is used for debugging.  It has only one port, {\tt in}.
11 Programmers should send debug report values to this port.  How such
12 values are reported back to the programmer doing the debugging is left
13 unspecified.
14
15 \subsection*{To Do}
16
17 Provide an {\tt inOp} port and use opcode ports \cite{am25} to
18 effectively allow multiple independent ``debug streams''
19
20 Provide a way to programmatically read back the output of the debug
21 ship.
22
23 == Fleeterpreter ====================================================
24 public void service() {
25   if (box_in.dataReadyForShip())
26     ((Interpreter)getFleet()).debug(box_in.removeDataForShip());
27 }
28
29 == FleetSim ==============================================================
30
31 == FPGA ==============================================================
32
33   reg [`DATAWIDTH-1:0] out_d;
34   assign  out_d_ = out_d;
35
36   always @(posedge clk) begin
37     if (!rst) begin
38       `reset
39     end else begin
40       `flush
41       `cleanup
42       if (`in_full && `out_empty) begin
43         `drain_in
44         `fill_out
45         out_d <= in_d;
46       end
47     end
48   end
49
50 == Test ================================================================
51 #expect 25
52
53 #ship debug : Debug
54
55 debug.in:
56   set word= 25;
57   deliver;
58
59 == Contributors =========================================================
60 Adam Megacz <megacz@cs.berkeley.edu>