Skip to content

Commit

Permalink
git11 fix, moved global variable either to static or to the pespectiv…
Browse files Browse the repository at this point in the history
…e .c file
  • Loading branch information
Lingzhe Chester Cai committed Mar 21, 2024
1 parent 5c58dea commit 6c6d669
Show file tree
Hide file tree
Showing 13 changed files with 22 additions and 21 deletions.
5 changes: 5 additions & 0 deletions src/cmp_model.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ static void cmp_istreams(void);
static void cmp_cores(void);
static void warmup_uncore(uns proc_id, Addr addr, Flag write);

/**************************************************************************************/
/* Global vars */

Cmp_Model cmp_model;

/**************************************************************************************/
/* cmp_init */

Expand Down
1 change: 0 additions & 1 deletion src/cmp_model.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ typedef struct Cmp_Model_struct {
/**************************************************************************************/
/* Global vars */

Cmp_Model cmp_model;
extern Cmp_Model cmp_model;

/**************************************************************************************/
Expand Down
10 changes: 5 additions & 5 deletions src/debug/memview.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ typedef struct Proc_Info_struct {
/**************************************************************************************/
/* Global Variables */

FILE* trace;
Bank_Info* bank_infos;
Proc_Info* proc_infos;
Trigger* start_trigger;
Mem_Req_Type* req_types;
static FILE* trace;
static Bank_Info* bank_infos;
static Proc_Info* proc_infos;
static Trigger* start_trigger;
static Mem_Req_Type* req_types;

/**************************************************************************************/
/* Local Prototypes */
Expand Down
1 change: 1 addition & 0 deletions src/dumb_model.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ static Flag dumb_req_done(Mem_Req* req);
static Proc_Info* infos;
static Counter req_num;
static uns64 page_num_mask;
Dumb_Model dumb_model;

/**************************************************************************************/
/* dumb_init */
Expand Down
1 change: 0 additions & 1 deletion src/dumb_model.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ typedef struct Dumb_Model_struct {
/**************************************************************************************/
/* Global vars */

Dumb_Model dumb_model;
extern Dumb_Model dumb_model;

/**************************************************************************************/
Expand Down
2 changes: 1 addition & 1 deletion src/dvfs/perf_pred.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ enum {
static Counter chip_cycle_count;
static Stat_Mon* stat_mon;

Proc_Info* proc_infos;
static Proc_Info* proc_infos;

/* static function prototypes */
static void critical_access_plot(uns proc_id, Mem_Req_Type type, uns req_ret,
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/pin_trace_fe.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
/**************************************************************************************/
/* Global Variables */

char* trace_files[MAX_NUM_PROCS];
static char* trace_files[MAX_NUM_PROCS];

ctype_pin_inst* next_pi;

Expand Down
6 changes: 6 additions & 0 deletions src/icache_stage.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ extern Memory* mem;
extern Rob_Stall_Reason rob_stall_reason;
extern Rob_Block_Issue_Reason rob_block_issue_reason;


static Pb_Data* ic_pb_data; // cmp cne is fine for cmp now assuming homogeneous cmp
// But decided to use array for future use



/**************************************************************************************/
/* Local prototypes */

Expand Down
7 changes: 0 additions & 7 deletions src/icache_stage.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,6 @@ typedef struct Icache_Data_struct {
} Icache_Data;


/**************************************************************************************/
/* Global Variables */

Pb_Data* ic_pb_data; // cmp cne is fine for cmp now assuming homogeneous cmp
// But decided to use array for future use


/**************************************************************************************/
/* External Variables */

Expand Down
2 changes: 1 addition & 1 deletion src/pin/pin_lib/decoder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ ctype_pin_inst* pin_decoder_get_latest_inst() {
}

void pin_decoder_print_unknown_opcodes() {
for(const auto opcode : unknown_opcodes) {
for(const auto &opcode : unknown_opcodes) {
(*glb_err_ostream) << opcode << std::endl;
}
}
Expand Down
2 changes: 0 additions & 2 deletions src/pin/pin_lib/uop_generator.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,6 @@ typedef struct Trace_Uop_struct Trace_Uop;
extern int op_type_delays[NUM_OP_TYPES];
extern uns NEW_INST_TABLE_SIZE; // TODO: what is this?

char* trace_files[MAX_NUM_PROCS];

char dbg_print_buf[1024];

Trace_Uop*** trace_uop_bulk;
Expand Down
2 changes: 1 addition & 1 deletion src/prefetcher/l2l1pref.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

extern Memory* mem;
extern Dcache_Stage* dc;
Cache* l1_cache;
static Cache* l1_cache;

/***************************************************************************************/
/* Local Prototypes */
Expand Down
2 changes: 1 addition & 1 deletion src/prefetcher/l2way_pref.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ L2way_Rec** l2way_table;
L1pref_Req* l1pref_req_queue;
static Counter l1pref_send_no;
static Counter l1pref_req_no;
Cache* l1_cache;
static Cache* l1_cache;

/**************************************************************************************/

Expand Down

0 comments on commit 6c6d669

Please sign in to comment.