add flush support to ships
[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   assign  out_d_ = in_d;
34   assign  out_r_ = in_r;
35
36   always @(posedge clk) begin
37     if (!rst) begin
38       `reset
39     end else begin
40       `flush
41       in_a  <= out_a;
42     end
43   end
44
45 == Test ================================================================
46 #expect 25
47
48 #ship debug : Debug
49
50 debug.in:
51   set word= 25;
52   deliver;
53
54 == Contributors =========================================================
55 Adam Megacz <megacz@cs.berkeley.edu>