Skip to content

Commit

Permalink
clean up the code & add a debug option for primitives & move the TLM…
Browse files Browse the repository at this point in the history
… defines to shunt_typedef.h.
  • Loading branch information
victorbesy committed Nov 11, 2023
1 parent b066e2a commit 152d267
Show file tree
Hide file tree
Showing 5 changed files with 255 additions and 133 deletions.
12 changes: 6 additions & 6 deletions examples/makedir/run_examples_debug
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
./full_cleanup
rm -f shunt.log
#C
pushd .;cd ../c/primitives/makedir;echo $PWD |& tee $SHUNT_HOME/examples/makedir/shunt.log ;make USER_OPT='-g3 -DSHUNT_CLIENT_SERVER_C_DEBUG -DSHUNT_TLM_DEBUG -DSHUNT_DPI_C_DEBUG' |& tee -a $SHUNT_HOME/examples/makedir/shunt.log ;popd
pushd .;cd ../c/client_server/makedir;make USER_OPT='-g3 -DSHUNT_CLIENT_SERVER_C_DEBUG -DSHUNT_TLM_DEBUG -DSHUNT_DPI_C_DEBUG' |& tee -a $SHUNT_HOME/examples/makedir/shunt.log ;popd
pushd .;cd ../c/user_api/makedir/;echo $PWD |& tee -a $SHUNT_HOME/examples/makedir/shunt.log ;make USER_OPT='-g3 -DSHUNT_CLIENT_SERVER_C_DEBUG -DSHUNT_TLM_DEBUG -DSHUNT_DPI_C_DEBUG' |& tee -a $SHUNT_HOME/examples/makedir/shunt.log ;popd
pushd .;cd ../c/primitives/makedir;echo $PWD |& tee $SHUNT_HOME/examples/makedir/shunt.log ;make USER_OPT='-g3 -DSHUNT_CLIENT_SERVER_C_DEBUG -DSHUNT_TLM_DEBUG -DSHUNT_DPI_C_DEBUG -DSHUNT_PRIMITIVES_C_DEBUG' |& tee -a $SHUNT_HOME/examples/makedir/shunt.log ;popd
pushd .;cd ../c/client_server/makedir;make USER_OPT='-g3 -DSHUNT_CLIENT_SERVER_C_DEBUG -DSHUNT_TLM_DEBUG -DSHUNT_DPI_C_DEBUG -DSHUNT_PRIMITIVES_C_DEBUG' |& tee -a $SHUNT_HOME/examples/makedir/shunt.log ;popd
pushd .;cd ../c/user_api/makedir/;echo $PWD |& tee -a $SHUNT_HOME/examples/makedir/shunt.log ;make USER_OPT='-g3 -DSHUNT_CLIENT_SERVER_C_DEBUG -DSHUNT_TLM_DEBUG -DSHUNT_DPI_C_DEBUG -DSHUNT_PRIMITIVES_C_DEBUG' |& tee -a $SHUNT_HOME/examples/makedir/shunt.log ;popd
#SV
command -v verilator >/dev/null 2>&1 || { echo >&2 "Shunt SV tests are required verilator but it's not installed.";}
pushd .;cd ../sv/sv2c/makedir;echo $PWD |& tee -a $SHUNT_HOME/examples/makedir/shunt.log ;./verilator_run |& tee -a $SHUNT_HOME/examples/makedir/shunt.log ;popd
#SC
pushd .; cd ../sc/LT_simple_cs/makedir;echo $PWD |& tee -a $SHUNT_HOME/examples/makedir/shunt.log r;make USER_OPT='-g3 -DSHUNT_CLIENT_SERVER_C_DEBUG -DSHUNT_TLM_DEBUG -DSHUNT_DPI_C_DEBUG' all |& tee -a $SHUNT_HOME/examples/makedir/shunt.log;popd
pushd .; cd ../sc/LT_simple_trns/makedir;echo $PWD |& tee -a $SHUNT_HOME/examples/makedir/shunt.log ;make USER_OPT='-g3 -DSHUNT_CLIENT_SERVER_C_DEBUG -DSHUNT_TLM_DEBUG -DSHUNT_DPI_C_DEBUG' all |& tee -a $SHUNT_HOME/examples/makedir/shunt.log;popd
pushd .; cd ../sc/LT_simple_sv/makedir;echo $PWD |& tee -a $SHUNT_HOME/examples/makedir/shunt.log ;make USER_OPT='-g3 -DSHUNT_CLIENT_SERVER_C_DEBUG -DSHUNT_TLM_DEBUG -DSHUNT_DPI_C_DEBUG' all |& tee -a $SHUNT_HOME/examples/makedir/shunt.log;popd
pushd .; cd ../sc/LT_simple_cs/makedir;echo $PWD |& tee -a $SHUNT_HOME/examples/makedir/shunt.log r;make USER_OPT='-g3 -DSHUNT_CLIENT_SERVER_C_DEBUG -DSHUNT_TLM_DEBUG -DSHUNT_DPI_C_DEBUG -DSHUNT_PRIMITIVES_C_DEBUG' all |& tee -a $SHUNT_HOME/examples/makedir/shunt.log;popd
pushd .; cd ../sc/LT_simple_trns/makedir;echo $PWD |& tee -a $SHUNT_HOME/examples/makedir/shunt.log ;make USER_OPT='-g3 -DSHUNT_CLIENT_SERVER_C_DEBUG -DSHUNT_TLM_DEBUG -DSHUNT_DPI_C_DEBUG -DSHUNT_PRIMITIVES_C_DEBUG' all |& tee -a $SHUNT_HOME/examples/makedir/shunt.log;popd
pushd .; cd ../sc/LT_simple_sv/makedir;echo $PWD |& tee -a $SHUNT_HOME/examples/makedir/shunt.log ;make USER_OPT='-g3 -DSHUNT_CLIENT_SERVER_C_DEBUG -DSHUNT_TLM_DEBUG -DSHUNT_DPI_C_DEBUG -DSHUNT_PRIMITIVES_C_DEBUG' all |& tee -a $SHUNT_HOME/examples/makedir/shunt.log;popd
#
egrep -a '(loopback|TEST\ PASS|test\ is\ finished)' shunt.log
egrep -ai '(error|warning)' shunt.log | grep -v Werror
94 changes: 94 additions & 0 deletions utils/c/include/shunt_typedef.h
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,100 @@ typedef struct cs_tlm_generic_payload_header_t {
} cs_tlm_generic_payload_header;
#endif

//---------------------------------------------------------------------------
// group: TLM enumeration types (extension of systemc tlm.h )
//---------------------------------------------------------------------------
/* Enum: shunt_tlm_command
Ref to SystemC tlm_gp.h tlm_command enum for TLM_READ_COMMAND , TLM_WRITE_COMMAND, and TLM_IGNORE_COMMAND
--- Code
typedef enum shunt_tlm_command {
TLM_READ_COMMAND, //
TLM_WRITE_COMMAND,
TLM_IGNORE_COMMAND,
SHUNT_TLM_END_SIM, // end of Client simulation, send by Server
SHUNT_TLM_START_SIM // start of simulation,send by Target
} shunt_dpi_tlm_command_e;
---
*/
typedef enum shunt_tlm_command {
TLM_READ_COMMAND,
TLM_WRITE_COMMAND,
TLM_IGNORE_COMMAND,
SHUNT_TLM_END_SIM,
SHUNT_TLM_START_SIM
} shunt_dpi_tlm_command_e;

/* Enum: tlm_response_status
cloned from SystemC tlm_gp.h tlm_response_status
--- Code
enum tlm_response_status {
TLM_OK_RESPONSE = 1,
TLM_INCOMPLETE_RESPONSE = 0,
TLM_GENERIC_ERROR_RESPONSE = -1,
TLM_ADDRESS_ERROR_RESPONSE = -2,
TLM_COMMAND_ERROR_RESPONSE = -3,
TLM_BURST_ERROR_RESPONSE = -4,
---
*/
enum tlm_response_status {
TLM_OK_RESPONSE = 1,
TLM_INCOMPLETE_RESPONSE = 0,
TLM_GENERIC_ERROR_RESPONSE = -1,
TLM_ADDRESS_ERROR_RESPONSE = -2,
TLM_COMMAND_ERROR_RESPONSE = -3,
TLM_BURST_ERROR_RESPONSE = -4,
TLM_BYTE_ENABLE_ERROR_RESPONSE = -5
};

/* Enum: tlm_gp_option
cloned from SystemC tlm_gp.h
--- Code
enum tlm_gp_option {
TLM_MIN_PAYLOAD,
TLM_FULL_PAYLOAD,
TLM_FULL_PAYLOAD_ACCEPTED
};
---
*/
enum tlm_gp_option {
TLM_MIN_PAYLOAD,
TLM_FULL_PAYLOAD,
TLM_FULL_PAYLOAD_ACCEPTED
};

/* Enum: tlm_phase_enum
cloned from SystemC tlm_phase.h
--- Code
enum tlm_phase_enum
{
UNINITIALIZED_PHASE=0,
BEGIN_REQ=1,
END_REQ,
BEGIN_RESP,
END_RESP
};
---
*/
enum tlm_phase_enum
{
UNINITIALIZED_PHASE=0,
BEGIN_REQ=1,
END_REQ,
BEGIN_RESP,
END_RESP
};

/* Enum: tlm_sync_enum
cloned from SystemC tlm_phase.h
--- Code
enum tlm_sync_enum {
TLM_ACCEPTED,
TLM_UPDATED,
TLM_COMPLETED };
---
*/
enum tlm_sync_enum { TLM_ACCEPTED, TLM_UPDATED, TLM_COMPLETED };

/*
Variable: cs_tlm_axi3_extension_payload_header
Expand Down
Loading

0 comments on commit 152d267

Please sign in to comment.