1 2 3 4 5 6 7 8 9 10 11
12
13 14 15
16 package ti.platforms.tiva;
17
18 /*!
19 * ======== Platform ========
20 * A generic platform that supports any Tiva device
21 *
22 * The device to be used by this platform is passed as the platform instance
23 * name. On the `xdc.tools.configuro` command line, it is done in the
24 * following way:
25 * @p(code)
26 * xs xdc.tools.configuro ... -p "ti.platforms.tiva:TM4C1290NCZAD"
27 * @p
28 *
29 * In package.bld, the platform instance is selected as in:
30 * @p(code)
31 * Pkg.addExecutable("test", target, "ti.platforms.tiva:TM4C1290NCZAD");
32 * @p
33 */
34 @Template ("./Platform.xdt")
35 metaonly module Platform inherits xdc.platform.IPlatform
36 {
37 config xdc.platform.IPlatform.Board BOARD = {
38 id: "0",
39 boardName: "tiva",
40 boardFamily: null,
41 boardRevision: null
42 };
43
44 /*!
45 * ======== nameFormat ========
46 * Encoding of instance creation parameters in the instance's name
47 *
48 * For this platform, the parameters `deviceName`, `includeLinkCmdFile`
49 * and `clockRate` can be encoded in the instance name supplied on
50 * `xdc.tools.configuro` command line, for example:
51 * @p(code)
52 * xs xdc.tools.configuro ... -p ti.platforms.tiva:TM4C1290NCZAD:1:20
53 * @p
54 * Optional parameters can be omitted:
55 * @p(code)
56 * xs xdc.tools.configuro ... -p ti.platforms.tiva:TM4C1290NCZAD
57 * @p
58 */
59 readonly config string nameFormat
60 = "$(deviceName):$(includeLinkCmdFile):$(clockRate)";
61
62 instance:
63
64 65 66 67 68
69 config xdc.platform.IExeContext.Cpu CPU = {
70 id: "0",
71 clockRate: 1.0,
72 catalogName: "ti.catalog.arm.cortexm4",
73 deviceName: "Tiva",
74 revision: "",
75 };
76
77 /*!
78 * ======== deviceName ========
79 * The name of an `ICpuDataSheet` module for the device
80 *
81 * This parameter is required, but it does not have to be set explicitly;
82 * it can be encoded in the instance's name.
83 */
84 config string deviceName;
85
86 /*!
87 * ======== clockRate ========
88 * The clock rate for this device.
89 */
90 config Double clockRate;
91
92 override config string codeMemory = null;
93
94 override config string dataMemory = null;
95
96 override config string stackMemory = null;
97
98 /*!
99 * ======== includeLinkCmdFile ========
100 * The flag that specifies if the platform should include a linker command
101 * file.
102 *
103 * By default, a user is responsible for adding a linker command file to
104 * the project, or to the linker command line. However, if this flag is
105 * set, this platform will include a default linker command file for the
106 * selected device.
107 */
108 config Bool includeLinkCmdFile = false;
109 };
110 111 112
113