11 const size_t SCD_CM_MAXLEN = 512;
12 const size_t SCD_CM_HEADER = 3*2;
15 const uint16_t SCD_CM_REGISTER = 1;
16 const uint16_t SCD_CM_CONFIG = 2;
17 const uint16_t SCD_CM_CONTROL = 3;
19 /* command subtypes */
21 const uint16_t SCD_CM_NETSIM = 1;
22 const uint16_t SCD_CM_CHANNEL = 2;
24 const uint16_t SCD_CM_BUSY = 1;
25 const uint16_t SCD_CM_IDLE = 2;
26 const uint16_t SCD_CM_DONE = 3;
27 const uint16_t SCD_CM_FAILED = 4;
28 const uint16_t SCD_CM_TIME_REQ = 5;
29 const uint16_t SCD_CM_TIME_ACK = 6;
30 const uint16_t SCD_CM_TIME_NACK = 7;
31 const uint16_t SCD_CM_TIME = 8;
32 const uint16_t SCD_CM_TERM_REQ = 9;
33 const uint16_t SCD_CM_TERM_ACK = 10;
34 const uint16_t SCD_CM_TERM_NACK = 11;
35 const uint16_t SCD_CM_TERM = 12;
37 /* forward declarations */
38 class scd_command_reader;
39 class scd_command_writer;
43 * Command class. Commands are control messages that are sent between
44 * the different simulators. A command has a type, a subtype and a potential
49 friend class scd_command_reader;
50 friend class scd_command_writer;
54 * Default constructor. Creates an empty command.
59 * Constructor. Creates a command with no message part.
60 * \param type the type of this command
61 * \param subtype the subtype of this command
63 scd_command(uint16_t type, uint16_t subtype);
66 * Constructor. Creates a new command with a string as message
69 scd_command(uint16_t type, uint16_t subtype, const std::string& msg);
72 * Constructor. Creates a new command with a SystemC time value as
75 scd_command(uint16_t type, uint16_t subtype, const sc_core::sc_time& time);
77 virtual ~scd_command();
80 * Returns the type of the command.
82 uint16_t get_type() const;
85 * Returns the subtype of the command.
87 uint16_t get_subtype() const;
90 * Returns the message part interpreted as a string.
92 std::string get_string() const;
95 * Returns the message part interpreted as a SystemC time.
96 * If the message part does not have the correct size SC_ZERO_TIME
97 * is returned instead.
99 sc_core::sc_time get_time() const;