add rst wire (but do not do anything with it)
[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 `include "macros.v"
33
34 module debug (clk, rst,
35               data_debug_data_r, data_debug_data_a, data_debug_data,
36               data_debug_out_r, data_debug_out_a, data_debug_out );
37   input clk;
38   input rst;
39
40   input  data_debug_data_r;
41   output data_debug_data_a;
42   input  [`DATAWIDTH:0] data_debug_data;
43
44   output  data_debug_out_r;
45   input   data_debug_out_a;
46   output  [`DATAWIDTH:0] data_debug_out;
47
48   assign  data_debug_out_r  = data_debug_data_r;
49   assign  data_debug_data_a = data_debug_out_a;
50   assign  data_debug_out    = data_debug_data;
51
52 endmodule
53
54 == Test ================================================================
55 #expect 25
56
57 #ship debug : Debug
58
59 debug.in:
60   literal 25;
61   deliver;
62
63 == Contributors =========================================================
64 Adam Megacz <megacz@cs.berkeley.edu>