Skip to content

Commit 64610bd

Browse files
committed
move the statefile args into manifold config file
1 parent de4b210 commit 64610bd

20 files changed

+59
-46
lines changed

setup.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,5 +85,5 @@ if [ $? -eq "0" ]; then
8585
echo -e "\n${bold}Manifold built successfully!${normal}\n\n"
8686
echo -e "Simulation Example:"
8787
echo -e "cd simulator/smp/QsimProxy"
88-
echo -e "smp_llp ../config/conf2x3_spx_torus_llp.cfg ../state/state.4 ../benchmark/graphbig_x86/bc.tar"
88+
echo -e "./smp_llp ../config/conf2x2_spx_t6p_llp.cfg ../benchmark/graphbig_x86/bc.tar"
8989
fi

simulator/smp/QsimProxy/smp_l1l2.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ int main(int argc, char** argv)
6868
std::cout.rdbuf(DBG_LOG.rdbuf()); // redirect cout
6969
#endif
7070

71-
sysBuilder.build_system(args, argv[2], argv[3], N_LPs, SysBuilder_llp::PART_1);
71+
sysBuilder.build_system(args, argv[2], N_LPs, SysBuilder_llp::PART_1);
7272

7373

7474
//==========================================================================

simulator/smp/QsimProxy/smp_llp.cc

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ using namespace manifold::kernel;
4444

4545
int main(int argc, char** argv)
4646
{
47-
if(argc != 4) {
48-
cerr << "Usage: mpirun -np <NP> " << argv[0] << " <config_file> <state_file> <benchmark_tar_file>" << endl;
47+
if(argc != 3) {
48+
cerr << "Usage: mpirun -np <NP> " << argv[0] << " <config_file> <benchmark_tar_file>" << endl;
4949
exit(1);
5050
}
5151

@@ -78,7 +78,7 @@ int main(int argc, char** argv)
7878
std::cout.rdbuf(DBG_LOG.rdbuf()); // redirect cout
7979
#endif
8080

81-
sysBuilder.build_system(args, argv[2], argv[3], N_LPs, SysBuilder_llp::PART_1);
81+
sysBuilder.build_system(args, argv[2], N_LPs, SysBuilder_llp::PART_1);
8282

8383

8484
//==========================================================================

simulator/smp/common/qsim_builder.cc

+9-8
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,12 @@ using namespace manifold::uarch;
99
using namespace manifold::qsim_proxy;
1010
using namespace Qsim;
1111

12-
void QsimProxyBuilder::read_config(Config& config, const char* stateFile, const char*appFile)
12+
void QsimProxyBuilder::read_config(Config& config, const char*appFile)
1313
{
14-
strcpy(state_file, stateFile);
15-
strcpy(app_file, appFile);
16-
1714
try {
1815
qsim_interrupt_handler_clock = config.lookup("qsim_interrupt_handler_clock");
16+
const char* stateFile = config.lookup("processor.state");
17+
strcpy(state_file,stateFile);
1918
uint64_t default_clock = config.lookup("default_clock");
2019
qsim_interrupt_interval = default_clock/qsim_interrupt_handler_clock;
2120
}
@@ -27,6 +26,8 @@ void QsimProxyBuilder::read_config(Config& config, const char* stateFile, const
2726
cout << e.getPath() << " has incorrect type." << endl;
2827
exit(1);
2928
}
29+
30+
strcpy(app_file, appFile);
3031
}
3132

3233
void QsimProxyBuilder::create_qsim(int LP)
@@ -54,13 +55,12 @@ void QsimProxyBuilder::print_stats(std::ostream& out)
5455

5556

5657

57-
void QsimLibBuilder::read_config(Config& config, const char* stateFile, const char* appFile)
58+
void QsimLibBuilder::read_config(Config& config, const char* appFile)
5859
{
59-
strcpy(state_file, stateFile);
60-
strcpy(app_file, appFile);
61-
6260
try {
6361
qsim_interrupt_handler_clock = config.lookup("qsim_interrupt_handler_clock");
62+
const char* stateFile = config.lookup("processor.state");
63+
strcpy(state_file,stateFile);
6464
}
6565
catch(SettingNotFoundException e) {
6666
cout << e.getPath() << " not set." << endl;
@@ -70,6 +70,7 @@ void QsimLibBuilder::read_config(Config& config, const char* stateFile, const ch
7070
cout << e.getPath() << " has incorrect type." << endl;
7171
exit(1);
7272
}
73+
strcpy(app_file, appFile);
7374
}
7475

7576
void QsimLibBuilder::create_qsim(int LP)

simulator/smp/common/qsim_builder.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class QsimBuilder {
1616
int get_component_id() const { return component_id; }
1717
Qsim::OSDomain* get_qsim_osd() const { return qsim_osd; }
1818

19-
virtual void read_config(libconfig::Config& config, const char* stateFile, const char* appFile) = 0;
19+
virtual void read_config(libconfig::Config& config, const char* appFile) = 0;
2020
virtual void create_qsim(int LP) = 0;
2121
virtual void print_config(std::ostream&) = 0;
2222
virtual void print_stats(std::ostream&) = 0;
@@ -38,7 +38,7 @@ class QsimProxyBuilder : public QsimBuilder {
3838
QsimProxyBuilder(SysBuilder_llp* b) : QsimBuilder(b) {}
3939
~QsimProxyBuilder() {}
4040

41-
void read_config(libconfig::Config& config, const char* stateFile, const char* appFile);
41+
void read_config(libconfig::Config& config, const char* appFile);
4242
void create_qsim(int LP);
4343
void print_config(std::ostream&);
4444
void print_stats(std::ostream&);
@@ -54,7 +54,7 @@ class QsimLibBuilder : public QsimBuilder {
5454
QsimLibBuilder(SysBuilder_llp* b) : QsimBuilder(b) {}
5555
~QsimLibBuilder() {}
5656

57-
void read_config(libconfig::Config& config, const char* stateFile, const char* appFile);
57+
void read_config(libconfig::Config& config, const char* appFile);
5858
void create_qsim(int LP);
5959
void print_config(std::ostream&);
6060
void print_stats(std::ostream&);

simulator/smp/common/sysBuilder_llp.cc

+4-4
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ void SysBuilder_llp :: build_system(Qsim::OSDomain* qsim_osd, vector<string>& ar
294294
//====================================================================
295295
// For QsimProxy front-end
296296
//====================================================================
297-
void SysBuilder_llp :: build_system(vector<string>& args, const char *stateFile, const char* appFile, int n_lps, int part)
297+
void SysBuilder_llp :: build_system(vector<string>& args, const char* appFile, int n_lps, int part)
298298
{
299299
assert(m_conf_read == true);
300300

@@ -317,7 +317,7 @@ void SysBuilder_llp :: build_system(vector<string>& args, const char *stateFile,
317317

318318
assert(m_proc_builder->get_fe_type() == ProcBuilder::INVALID_FE_TYPE);
319319
m_proc_builder->set_fe_type(ProcBuilder::QSIMPROXY);
320-
create_qsimproxy_nodes(args,stateFile,appFile,n_lps,part);
320+
create_qsimproxy_nodes(args,appFile,n_lps,part);
321321

322322
//connect components
323323
connect_components();
@@ -413,10 +413,10 @@ void SysBuilder_llp :: create_qsimlib_nodes(Qsim::OSDomain* qsim_osd, vector<str
413413

414414
//====================================================================
415415
//====================================================================
416-
void SysBuilder_llp :: create_qsimproxy_nodes(vector<string>& args, const char* stateFile, const char* appFile, int n_lps, int part)
416+
void SysBuilder_llp :: create_qsimproxy_nodes(vector<string>& args, const char* appFile, int n_lps, int part)
417417
{
418418
m_qsim_builder = new QsimProxyBuilder(this);
419-
m_qsim_builder->read_config(m_config, stateFile, appFile);
419+
m_qsim_builder->read_config(m_config, appFile);
420420
m_qsim_builder->create_qsim(0);
421421

422422
switch(m_proc_builder->get_proc_type()) {

simulator/smp/common/sysBuilder_llp.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class SysBuilder_llp {
4040
void config_system();
4141
void build_system(FrontendType type, int n_lps, std::vector<std::string>& args, int part); //for QSim client and tracefile
4242
void build_system(Qsim::OSDomain* osd, std::vector<std::string>& args); //for QSimLib
43-
void build_system(std::vector<std::string>& args, const char* stateFile, const char* appFile, int n_lps, int part); // for QSimProxy
43+
void build_system(std::vector<std::string>& args, const char* appFile, int n_lps, int part); // for QSimProxy
4444

4545
void pre_simulation();
4646
void print_config(std::ostream& out);
@@ -104,7 +104,7 @@ class SysBuilder_llp {
104104

105105
void create_qsimclient_nodes(int n_lps, std::vector<std::string>& argv, int part);
106106
void create_qsimlib_nodes(Qsim::OSDomain* qsim_osd, vector<string>& args);
107-
void create_qsimproxy_nodes(vector<string>& args, const char* stateFile, const char* appFile, int n_lps, int part);
107+
void create_qsimproxy_nodes(vector<string>& args, const char* appFile, int n_lps, int part);
108108
void create_trace_nodes(int n_lps, vector<string>& args, int part);
109109

110110
#ifdef LIBKITFOX

simulator/smp/config/conf2x2_spx_t6p_llp.a64.cfg

+11-10
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,18 @@ processor:
2727
type = "SPX";
2828
node_idx = [0, 1, 2, 3];
2929
config = "../config/spx-outorder.a64.config";
30+
state = "../state/state.4.a64"
3031
};
3132

3233
llp_cache:
3334
{
3435
name = "L1";
3536
type = "DATA";
3637
size = 0x8000; //32K
37-
assoc = 4;
38-
block_size = 32;
39-
hit_time = 2;
40-
lookup_time = 5;
38+
assoc = 8;
39+
block_size = 64;
40+
hit_time = 3;
41+
lookup_time = 3;
4142
replacement_policy = "LRU";
4243
mshr_size = 8;
4344

@@ -48,13 +49,13 @@ lls_cache:
4849
{
4950
name = "L2";
5051
type = "DATA";
51-
size = 0x40000; //256K
52-
assoc = 8;
53-
block_size = 32;
54-
hit_time = 2;
55-
lookup_time = 5;
52+
size = 0x200000; // 2MB
53+
assoc = 16;
54+
block_size = 64;
55+
hit_time = 35;
56+
lookup_time = 100;
5657
replacement_policy = "LRU";
57-
mshr_size = 16;
58+
mshr_size = 32;
5859

5960
downstream_credits = 20; //credits for sending to network
6061
};

simulator/smp/config/conf2x2_spx_t6p_llp.cfg

+11-10
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,18 @@ processor:
2727
type = "SPX";
2828
node_idx = [0, 1, 2, 3];
2929
config = "../config/spx-outorder.config";
30+
state = "../state/state.4"
3031
};
3132

3233
llp_cache:
3334
{
3435
name = "L1";
3536
type = "DATA";
3637
size = 0x8000; //32K
37-
assoc = 4;
38-
block_size = 32;
39-
hit_time = 2;
40-
lookup_time = 5;
38+
assoc = 8;
39+
block_size = 64;
40+
hit_time = 3;
41+
lookup_time = 3;
4142
replacement_policy = "LRU";
4243
mshr_size = 8;
4344

@@ -48,13 +49,13 @@ lls_cache:
4849
{
4950
name = "L2";
5051
type = "DATA";
51-
size = 0x40000; //256K
52-
assoc = 8;
53-
block_size = 32;
54-
hit_time = 2;
55-
lookup_time = 5;
52+
size = 0x200000; //2MB
53+
assoc = 16;
54+
block_size = 64;
55+
hit_time = 35;
56+
lookup_time = 100;
5657
replacement_policy = "LRU";
57-
mshr_size = 16;
58+
mshr_size = 32;
5859

5960
downstream_credits = 20; //credits for sending to network
6061
};

simulator/smp/config/conf2x3_spx_torus_l1l2.cfg

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ processor:
2424
node_idx = [0, 1, 3, 4];
2525
type = "SPX";
2626
config = "../config/spx-outorder.config";
27+
state = "../state/state.4";
2728
};
2829

2930

simulator/smp/config/conf2x3_spx_torus_llp.a64.cfg

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ processor:
2727
type = "SPX";
2828
node_idx = [0, 1, 3, 4];
2929
config = "../config/spx-outorder.a64.config";
30+
state = "../state/state.4.a64";
3031
};
3132

3233
llp_cache:

simulator/smp/config/conf2x3_spx_torus_llp.cfg

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ processor:
2525
type = "SPX";
2626
node_idx = [0, 1, 3, 4];
2727
config = "../config/spx-outorder.config";
28+
state = "../state/state.4";
2829
};
2930

3031
llp_cache:

simulator/smp/config/conf2x3_zesto_torus_l1l2.cfg

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ processor:
2424
node_idx = [0, 1, 3, 4];
2525
type = "ZESTO";
2626
config = "../config/zesto-6issue.config";
27+
state = "../state/state.4";
2728
};
2829

2930

simulator/smp/config/conf2x3_zesto_torus_llp.cfg

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ processor:
2424
node_idx = [0, 1, 3, 4];
2525
type = "ZESTO";
2626
config = "../config/zesto-6issue.config";
27+
state = "../state/state.4";
2728
};
2829

2930
llp_cache:

simulator/smp/config/conf4x4_spx_t6p_llp.cfg

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ processor:
2525
type = "SPX";
2626
node_idx = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];
2727
config = "../config/spx-outorder.config";
28+
state = "../state/state.16";
2829
};
2930

3031
llp_cache:

simulator/smp/config/conf4x5_simpleproc_torus_llp.cfg

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ processor:
2424
{
2525
node_idx = [0, 1, 2, 3, 4, 5, 6, 7, 12, 13, 14, 15, 16, 17, 18, 19];
2626
type = "SIMPLE";
27+
state = "../state/state.16";
2728
};
2829

2930
llp_cache:

simulator/smp/config/conf4x5_spx_torus_llp.cfg

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ processor:
2525
type = "SPX";
2626
node_idx = [0, 1, 2, 3, 4, 5, 6, 7, 12, 13, 14, 15, 16, 17, 18, 19];
2727
config = "../config/spx-outorder.config";
28+
state = "../state/state.16";
2829
};
2930

3031
llp_cache:

simulator/smp/config/conf4x5_zesto_torus_l1l2.cfg

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ processor:
2424
node_idx = [0, 1, 2, 3, 4, 5, 6, 7, 12, 13, 14, 15, 16, 17, 18, 19];
2525
type = "ZESTO";
2626
config = "../config/zesto-6issue.config";
27+
state = "../state/state.16";
2728
};
2829

2930

simulator/smp/config/conf4x5_zesto_torus_llp.cfg

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ processor:
2424
node_idx = [0, 1, 2, 3, 4, 5, 6, 7, 12, 13, 14, 15, 16, 17, 18, 19];
2525
type = "ZESTO";
2626
config = "../config/zesto-6issue.config";
27+
state = "../state/state.16";
2728
};
2829

2930
llp_cache:

simulator/smp/config/kitfox-4core.config

+4-4
Original file line numberDiff line numberDiff line change
@@ -5296,7 +5296,7 @@ component = {
52965296
size = 2097152;
52975297
tag_width = 47;
52985298
num_rw_ports = 1;
5299-
cycle_time = 35;
5299+
cycle_time = 100;
53005300
access_time = 35;
53015301
access_mode = "sequential";
53025302
};
@@ -5484,7 +5484,7 @@ component = {
54845484
size = 2097152;
54855485
tag_width = 47;
54865486
num_rw_ports = 1;
5487-
cycle_time = 35;
5487+
cycle_time = 100;
54885488
access_time = 35;
54895489
access_mode = "sequential";
54905490
};
@@ -5672,7 +5672,7 @@ component = {
56725672
size = 2097152;
56735673
tag_width = 47;
56745674
num_rw_ports = 1;
5675-
cycle_time = 35;
5675+
cycle_time = 100;
56765676
access_time = 35;
56775677
access_mode = "sequential";
56785678
};
@@ -5860,7 +5860,7 @@ component = {
58605860
size = 2097152;
58615861
tag_width = 47;
58625862
num_rw_ports = 1;
5863-
cycle_time = 35;
5863+
cycle_time = 100;
58645864
access_time = 35;
58655865
access_mode = "sequential";
58665866
};

0 commit comments

Comments
 (0)