use of net.praqma.jenkins.memorymap.graph.MemoryMapGraphConfiguration in project memory-map-plugin by Praqma.
the class GccMemoryMapParser method parseConfigFile.
@Override
public MemoryMapConfigMemory parseConfigFile(File f) throws IOException {
// Collect sections from both the MEMORY and the SECTIONS areas from the command file.
// The memory are the top level components, sections belong to one of these sections
CharSequence stripped = stripComments(createCharSequenceFromFile(f));
MemoryMapConfigMemory memConfig = getMemory(stripped);
memConfig.addAll(getSections(stripped));
for (MemoryMapGraphConfiguration g : getGraphConfiguration()) {
for (String gItem : g.itemizeGraphDataList()) {
for (String gSplitItem : gItem.split("\\+")) {
// We will fail if the name of the data section does not match any of the named items in the map file.
if (!memConfig.containsSectionWithName(gSplitItem)) {
throw new MemoryMapMemorySelectionError(String.format("The memory section named %s not found in map file%nAvailable sections are:%n%s", gSplitItem, memConfig.getItemNames()));
}
}
}
}
return memConfig;
}
use of net.praqma.jenkins.memorymap.graph.MemoryMapGraphConfiguration in project memory-map-plugin by Praqma.
the class TexasInstrumentsMemoryMapParser method parseConfigFile.
@Override
public MemoryMapConfigMemory parseConfigFile(File f) throws IOException {
MemoryMapConfigMemory config = new MemoryMapConfigMemory();
CharSequence sequence = createCharSequenceFromFile(f);
for (MemoryMapGraphConfiguration graph : getGraphConfiguration()) {
String[] split = graph.getGraphDataList().split(",");
for (String s : split) {
String[] multiSections = s.trim().split("\\+");
for (String ms : multiSections) {
Matcher m = MemoryMapConfigFileParserDelegate.getPatternForMemoryLayout(ms.replace(" ", "")).matcher(sequence);
MemoryMapConfigMemoryItem item = null;
while (m.find()) {
item = new MemoryMapConfigMemoryItem(m.group(1), m.group(3), m.group(5));
config.add(item);
}
if (item == null) {
logger.logp(Level.WARNING, "parseConfigFile", AbstractMemoryMapParser.class.getName(), String.format("parseConfigFile(List<MemoryMapGraphConfiguration> graphConfig, File f) non existing item: %s", s));
throw new MemoryMapMemorySelectionError(String.format("No match found for program memory named %s", s));
}
}
}
}
return config;
}
use of net.praqma.jenkins.memorymap.graph.MemoryMapGraphConfiguration in project memory-map-plugin by Praqma.
the class GccMemoryMapParserIT method gcc432_testUsageValues.
@Test
public void gcc432_testUsageValues() throws Exception {
MemoryMapGraphConfiguration graphConfiguration = new MemoryMapGraphConfiguration(".text+.rodata", "432");
GccMemoryMapParser parser = createParser(graphConfiguration);
parser.setMapFile("prom2_432.map");
parser.setConfigurationFile("prom432.ld");
HashMap<String, String> expectedValues = new HashMap<>();
expectedValues.put(".text", "0x10a008");
expectedValues.put(".rodata", "0x33fd7");
TestUtils.testUsageValues(jenkins, parser, "gcc432.zip", expectedValues);
}
use of net.praqma.jenkins.memorymap.graph.MemoryMapGraphConfiguration in project memory-map-plugin by Praqma.
the class GccMemoryMapParserIT method gcc482_testUsageValues.
@Test
public void gcc482_testUsageValues() throws Exception {
MemoryMapGraphConfiguration graphConfiguration = new MemoryMapGraphConfiguration(".prom_text+.ram_data", "482");
GccMemoryMapParser parser = createParser(graphConfiguration);
parser.setMapFile("gcc482.map");
parser.setConfigurationFile("prom482.ld");
HashMap<String, String> expectedValues = new HashMap<>();
expectedValues.put(".prom_text", "0x10cb70");
expectedValues.put(".ram_data", "0x20c4");
TestUtils.testUsageValues(jenkins, parser, "gcc482.zip", expectedValues);
}
use of net.praqma.jenkins.memorymap.graph.MemoryMapGraphConfiguration in project memory-map-plugin by Praqma.
the class TexasInstrumentsMemoryMapParserIT method testUsageValues.
@Test
public void testUsageValues() throws Exception {
MemoryMapGraphConfiguration graphConfiguration = new MemoryMapGraphConfiguration("RAMM0+RAML0_L3", "432");
TexasInstrumentsMemoryMapParser parser = createParser(graphConfiguration);
parser.setMapFile("TexasInstrumentsMapFile.txt");
parser.setConfigurationFile("28069_RAM_lnk.cmd");
HashMap<String, String> expectedValues = new HashMap<>();
expectedValues.put("RAMM0", "00000195");
expectedValues.put("RAML0_L3", "00001a8f");
TestUtils.testUsageValues(jenkins, parser, "ti.zip", expectedValues);
}
Aggregations