summaryrefslogtreecommitdiff
path: root/bootwrapper/big-little-mp1.mxscript
blob: c8c05eec5ab30a7de69970db59c0eb30e9ac5d80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
// SET THE DEFAULT FASTMODELS PARAMETERS
//
// 1. Replace the string with the absolute path of the FastModel executable
//    e.g. string model = "/home/working_dir/RTSM_VE_Cortex-A15x1-A7x1";
string model = "<path to the model>";

// 2. Replace the string with the absolute path of the Virutalizer+Payload software
//    image e.g. string app = "/home/working_dir/bootwrapper/img.axf".
string app   = "<path to the software image>";

// 3. Replace the string with the absolute path of the wboot.bin image created in
//    the bootwrapper/big-little directory. This image is load in flash at 0x0
//    and distinguishes between a warm and a cold reset.
string wboot = "<path to warm reset handler image>";

// 4. Invoke the FastModel with support for networking enabled.
string networking = " -C motherboard.hostbridge.userNetworking=1 -C motherboard.hostbridge.userNetPorts=\"8080=8080\" -C motherboard.smsc_91c111.enabled=1";

// 5. Additional parameters to improve FastModels performance.
string console = " -C motherboard.pl011_uart0.untimed_fifos=1 -C motherboard.pl011_uart1.untimed_fifos=1 -C motherboard.pl011_uart2.untimed_fifos=1 -C motherboard.pl011_uart3.untimed_fifos=1";

// 6. Select which cluster (Boot Cluster mentioned in "docs/01-Usage.txt")
//    will come out of reset on power-on: 0x1 for for primary cluster
//    (Cortex-A15, default); 0x2 for secondary cluster (Cortex-A7).
string dualcluster = " -C coretile.dualclustersystemconfigurationblock.CFG_ACTIVECLUSTER=0x1";


// INCLUDE OPTIONAL FASTMODELS PARAMETERS
//
// 1. Using the Generic Trace plugin
//
//    Uncomment the next 4 'string' variables and update them _only_ if the run
//    is required to generate trace output as described in
//    docs/04-Cache-hit-rate-howto.txt. Also, ensure that the 4 string variables
//    are appended to the system() command invocation below. Each 'trace'
//    parameter is described below.
//
//   a. Add the path to the trace plugin
//      string trace_plugin = " --trace-plugin <path to>/GenericTrace.so";
//
//   b. Add parameters for selecting the trace sources to monitor outbound cache
//      hits
//      string trace_sources = " --parameter TRACE.GenericTrace.trace-sources=\*sw_trace_event\*,\*read_for_3_came_from_snoop\*,\*read_for_4_came_from_snoop\* ";
//
//   c. Add the path to the trace file where all the output will be collected
//      string trace_file = " --parameter TRACE.GenericTrace.trace-file=<path to trace file> ";
//
//   d. Add miscellaneous parameters. The frequency at which the performance
//      metrics of the model appear in the trace source can be changed here
//      (default is 0x100).
//      string trace_misc = " -C TRACE.GenericTrace.perf-period=0x100 -C TRACE.GenericTrace.flush=1 ";
//
// 2. Using MMC emulation
//
//    Uncomment the 'mmcimage' string variable _only_ if a run is needed using
//    an optional rootfs MMC image built using the instructions in
//    docs/06-Optional-rootfs-build.txt. Also ensure that the 'mmcimage' string
//    variable is appended to the system() command invocation below.
//    string mmcimage  = " -C motherboard.mmc.p_mmc_file=<path to mmc.img>";


// START FASTMODEL EXECUTION & SET BREAKPOINTS
//
// Invoke the model using the system(0 command below. It then listens for
// connection requests from the model debugger Vanilla invocation of the
// model. Append the string variables for optional parameters to the
// system() command.
system(model + " -C motherboard.flashloader0.fname=" + wboot + " -C coretile.cache_state_modelled=1" + " -a coretile.cluster0.\*=" + app + " -a coretile.cluster1.\*=" + app + networking + console + dualcluster +" --verbose -S &");

// Wait for the model to load before connecting to it. There will be times when we
// try connecting before the model has loded resulting in a "Connection refused"
// error. Increasing 'ctr' or retrying should solve the problem.
int ctr = 0;
while(ctr < 400000000)
{
	ctr++;
}

// Model listens at port 7000
connectToModel("7000");

// The following lines can be uncommented to set any breakpoints on each cluster
selectTarget("coretile.cluster0.cpu0");
//bpAdd(<address>, "Normal");
//bpAdd(<address>, "Secure");
selectTarget("coretile.cluster1.cpu0");
//bpAdd(<address>, "Normal");
//bpAdd(<address>, "Secure");

// Select the primary cpu on the primary cluster and set the ball rolling
selectTarget("coretile.cluster0.cpu0");
run();