Design Cases
Develop a Target That Reuses the Features of the Reference Target but Replaces the Deployer With a New Deployer Created from Scratch
This example shows how to develop a target for a fictitious ACME Zynq-7000 board. You create the target using the ARM® Cortex®-A target as a reference.
The new target will support the ACME Zynq-7000 board. For both boards, the new deployer using Linaro Toolchain 4.9 will be used. The other features are used from the reference target.
For testing, the target will use the ARM Cortex-A (QEMU) emulator from the reference with the same features as the ACME Zynq-7000 Board.
The hardware to feature mapping of the new target is shown in the following table.
Name | Hardware | |
---|---|---|
ACME Cortex-A (QEMU) from reference | ACME Zynq-7000 Board new | |
Deployer: ACME Linaro 4.9 | New | New |
Scheduler: Linux | From reference | From reference |
PIL: Ethernet | From reference | From reference |
External mode: Ethernet | From reference | From reference |
Profiler: Linux | From reference | From reference |
Identify reference target, name the new target, and create the framework in the specified root folder.
referenceTargetName = 'ARM Cortex-A'; myNewTargetName = 'Target for ACME Zynq hardware'; myNewTargetRootFolder = 'c:/acmezynq'; myNewTarget = createTarget(myNewTargetName,referenceTargetName,myNewTargetRootFolder,'initialize');
Define the hardware that you want to support.
myNewHardware1 = getHardware(myNewTarget,'mapped'); setDisplayName(myNewTarget,myNewHardware1,'ACME Cortex A QEMU'); myNewHardwareName2 = 'ACME Board No 1'; myNewHardware2 = createHardware(myNewHardwareName2); myNewHardware2.DeviceID = 'ARM Cortex-A9'; ioInterfaceName = 'ACME Zynq 7000 Board Ethernet'; ethernetInterface = addNewEthernetInterface(myNewHardware2,ioInterfaceName); ethernetInterface.IPAddress = '121.101.101.11'; ethernetInterface.Port = 17745; map(myNewTarget,myNewHardware2,'ACME Zynq 7000 Board');
Define the new feature configuration.
deployerName = 'ACME Linaro 4.9'; myNewDeployer = addNewDeployer(myNewTarget,deployerName); toolchainName = 'Linaro Toolchain 4.9'; myNewToolchain = addNewToolchain(myNewDeployer,toolchainName); myNewLoader = myNewDeployer.addNewLoader('ACME Zynq-7000 Board Loader'); myNewLoader.LoadCommand = 'MATLAB:acmesofttarget.internal.downloadandrun';
Use the new feature configuration for the supported hardware. First, remap the deployer, then get the features, and then remap the deployer again.
referenceDeployer = getDeployer(myNewTarget,'mapped',myNewHardware1);
unmap(myNewTarget,referenceDeployer);
map(myNewTarget,myNewHardware1,myNewDeployer);
Use the existing operating system, profiler, external mode, and PIL features for the supported hardware.
referenceOS = getOperatingSystem(myNewTarget,'mapped',myNewHardware1); referenceProfiler = getProfiler(myNewTarget,'mapped',myNewHardware1); map(myNewTarget,myNewHardware2,[{myNewDeployer},referenceOS,referenceProfiler]); referenceExternalmode = getExternalMode(myNewTarget,'mapped',myNewHardware1); map(myNewTarget,myNewHardware2,referenceExternalmode,'ACME Zynq 7000 Board Ethernet'); referencePIL = getPIL(myNewTarget,'mapped',myNewHardware1); map(myNewTarget,myNewHardware2,referencePIL,'ACME Zynq 7000 Board Ethernet');
Unmap the reference deployer from the new target. You do not want to use the feature configuration of the reference target for the new supported hardware.
referenceDeployer = getDeployer(myNewTarget,'name','Linaro 4.8'); unmap(myNewTarget,referenceDeployer);
Save the new target.
saveTarget(myNewTarget);
Develop a Target That Creates Features From Scratch Except for the Deployer That is Reused From the Reference Target
This example shows how to develop a target for two fictitious Altera® boards. You create the target using ARM Cortex-A target as a reference.
The target will support ABC-ALTZ32 and ABC-ALTZ120 board. For both boards, the deployer defined in the reference target and using Linaro Toolchain 4.8 will be used. The operating system, PIL, external mode, and profiler feature will be defined by the target itself and used for both modules.
The hardware to feature mapping of the new target is shown in the following table.
Name | Hardware | |
---|---|---|
ABC-ALTZ32 Board New | ABC-ALTZ120 Board New | |
Deployer: GNU Tools for ARM Embedded Processors | From reference | From reference |
Scheduler: ACME SysTick Scheduler | New | New |
PIL: My Ethernet PIL | New | New |
External mode: My Ethernet External Mode | New | New |
Identify reference target, name the new target, and create the framework in the specified root folder.
referenceTargetName = 'ARM Cortex-A'; myNewTargetName = 'Target for ABC Ventures Altera Boards'; myNewTargetRootFolder = 'c:/abcaltera'; myNewTarget = createTarget(myNewTargetName,referenceTargetName,myNewTargetRootFolder);
Define the hardware that you want to support.
myNewHardwareName1 = 'ABC-ALTZ32'; myNewHardware1 = createHardware(myNewHardwareName1); myNewHardware1.DeviceID = 'ARM Cortex-A9'; ioInterfaceName = 'My Ethernet Connection 1'; ethernetInterface1 = addNewEthernetInterface(myNewHardware1,ioInterfaceName); ethernetInterface1.IPAddress = '121.101.101.11'; ethernetInterface1.Port = 17745; map(myNewTarget,myNewHardware1, 'ABC Ventures ABC ALTZ32 Board'); myNewHardwareName2 = 'ABC ALTZ120 '; myNewHardware2 = createHardware(myNewHardwareName2); myNewHardware2.DeviceID = 'ARM Cortex-A9'; ioInterfaceName = 'My Ethernet Connection 2'; ethernetInterface2 = addNewEthernetInterface(myNewHardware2,ioInterfaceName); ethernetInterface2.IPAddress = '10.10.10.1'; ethernetInterface2.Port = 17745; map(myNewTarget,myNewHardware2, 'ABC Ventures ABC ALTZ120 Board');
Define the new feature configuration.
myNewScheduler = addNewOperatingSystem(myNewTarget,'Linux'); myNewExtMode = addNewExternalMode(myNewTarget,'My Ethernet External Mode'); myNewExtMode.SourceFiles = {'$(TARGET_ROOT)/src/abc_rtiostream_serial.c'}; myNewPIL = addNewPIL(myNewTarget,'My Ethernet PIL'); refDeployer = getDeployer(myNewTarget,'name','Linaro Toolchain v4.8');
Use the new feature configuration for the supported hardware.
map(myNewTarget,myNewHardware1,{refDeployer,myNewScheduler}); map(myNewTarget,myNewHardware1,myNewPIL,'My Ethernet Connection 1'); map(myNewTarget,myNewHardware1,myNewExtMode,'My Ethernet Connection 1'); map(myNewTarget,myNewHardware2,{refDeployer,myNewScheduler}); map(myNewTarget,myNewHardware2,myNewPIL,'My Ethernet Connection 2'); map(myNewTarget,myNewHardware2,myNewExtMode,'My Ethernet Connection 2');
Save the new target.
saveTarget(myNewTarget);