Skip to content
Snippets Groups Projects
Commit 35902477 authored by Daniela Genius's avatar Daniela Genius
Browse files

third kind of HWA

parent e1d34916
No related branches found
No related tags found
1 merge request!72Syscams
Source diff could not be displayed: it is too large. Options to address this: view the blob.
...@@ -48,123 +48,169 @@ ...@@ -48,123 +48,169 @@
package ddtranslatorSoclib.toTopCell; package ddtranslatorSoclib.toTopCell;
import ddtranslatorSoclib.*; //DG 23.08. import ddtranslatorSoclib.*; //DG 23.08.
public class Header
{
public class Header {
static private String header; static private String header;
int nb_clusters=5; int nb_clusters = 5;
private final static String CR = "\n"; private final static String CR = "\n";
private final static String CR2 = "\n\n"; private final static String CR2 = "\n\n";
Header(){ Header ()
{
} }
public static String getHeader() { public static String getHeader ()
int with_vgsb=TopCellGenerator.avatardd.getAllBus().size(); {
int with_vgsb = TopCellGenerator.avatardd.getAllBus ().size ();
header = "//-------------------------------Header------------------------------------" + CR2
+ "#include <iostream>" + CR header =
+ "#include <cstdlib>" + CR "//-------------------------------Header------------------------------------"
+ "#include <vector>" + CR + CR2 + "#include <iostream>" + CR + "#include <cstdlib>" + CR +
+ "#include <string>" + CR "#include <vector>" + CR + "#include <string>" + CR +
+ "#include <stdexcept>" + CR "#include <stdexcept>" + CR + "#include <cstdarg>" + CR2 +
+ "#include <cstdarg>" +CR2 "#define CONFIG_GDB_SERVER" + CR +
+ "#define CONFIG_GDB_SERVER" + CR "#define CONFIG_SOCLIB_MEMCHECK" + CR2;
+ "#define CONFIG_SOCLIB_MEMCHECK" + CR2;
header = header + "#include \"iss_memchecker.h\"" + CR
header = header + "#include \"iss_memchecker.h\"" + CR + "#include \"gdbserver.h\"" + CR2
+"#include \"gdbserver.h\""+ CR2 + "#include \"ppc405.h\"" + CR
+"#include \"ppc405.h\"" + CR + "#include \"niosII.h\"" + CR
+"#include \"niosII.h\"" + CR + "#include \"mips32.h\"" + CR
+"#include \"mips32.h\"" + CR + "#include \"arm.h\"" + CR
+"#include \"arm.h\"" + CR + "#include \"sparcv8.h\"" + CR
+"#include \"sparcv8.h\"" + CR + "#include \"lm32.h\"" + CR2
+"#include \"lm32.h\"" + CR2
+ "#include \"mapping_table.h\"" + CR + "#include \"mapping_table.h\"" + CR
+ "#include \"vci_fdt_rom.h\"" + CR + "#include \"vci_xcache_wrapper.h\"" + CR + "#include \"vci_fdt_rom.h\"" + CR +
+ "#include \"vci_ram.h\"" + CR + "#include \"vci_heterogeneous_rom.h\"" + CR "#include \"vci_xcache_wrapper.h\"" + CR +
+ "#include \"vci_multi_tty.h\"" + CR + "#include \"vci_locks.h\"" + CR + "#include \"vci_xicu.h\""+ CR "#include \"vci_ram.h\"" + CR +
+ "#include \"vci_mwmr_stats.h\""+ CR;//DG 20.09. "#include \"vci_heterogeneous_rom.h\"" + CR +
if (with_vgsb>0){ "#include \"vci_multi_tty.h\"" + CR
header +="#include \"vci_vgsb.h\""+ CR; //+ "#include \"vci_locks.h\"" + CR
} + "#include \"vci_xicu.h\"" + CR + "#include \"vci_mwmr_stats.h\"" + CR; //DG 20.09.
else{ if (with_vgsb > 0)
header +="#include \"vci_vgmn.h\""+ CR; {
} header += "#include \"vci_vgsb.h\"" + CR;
int with_hw_accellerator = 1; //DG 23.08. a la main }
if (with_hw_accellerator>0){ else
header +="#include \"vci_mwmr_controller.h\""+ CR; {
} header += "#include \"vci_vgmn.h\"" + CR;
//include statements for all coprocessors found }
//The user must ensure that there is a SoCLib component corresponding to this coprocessor int with_hw_accellerator = 1; //DG 23.08. a la main
// if (with_hw_accellerator>0){ if (with_hw_accellerator > 0)
//DG 23.08. actuellement il ne les trouve pas! {
int hwas=0; header += "#include \"mwmr_controller.h\"" + CR;
//header +="#include \"fifo_virtual_copro_wrapper.h\""+ CR; header += "#include \"vci_mwmr_controller.h\"" + CR;
}
for (AvatarCoproMWMR HWAccelerator : TopCellGenerator.avatardd.getAllCoproMWMR()) { //include statements for all coprocessors found
// String name = HWAccelerator.getCoprocName(); //The user must ensure that there is a SoCLib component corresponding to this coprocessor
// header +="#include \""+name+"\""+ CR; // if (with_hw_accellerator>0){
//DG 23.08. actuellement il ne les trouve pas!
//Per default for testing int hwas = 0;
// header +="#include \"input_coproc.h\""+ CR; header += "#include \"fifo_virtual_copro_wrapper.h\"" + CR;
//header +="#include \"output_coproc.hh\""+ CR;
for (AvatarCoproMWMR HWAccelerator:TopCellGenerator.avatardd.
/* can be found in /users/outil/soc/soclib/soclib/module/internal_component/fifo* */ getAllCoproMWMR ())
//header +="#include \"fifo_virtual_copro_wrapper.h\""+ CR; {
header +="#include \"my_hwa.h\""+ CR; // String name = HWAccelerator.getCoprocName();
hwas++; // header +="#include \""+name+"\""+ CR;
}
if (hwas>0) //Per default for testing
header +="#include \"fifo_virtual_copro_wrapper.h\""+ CR; // header +="#include \"input_coproc.h\""+ CR;
// } //header +="#include \"output_coproc.hh\""+ CR;
header+= "#include \"vci_block_device.h\"" + CR /* can be found in /users/outil/soc/soclib/soclib/module/internal_component/fifo* */
+ "#include \"vci_simhelper.h\"" + CR + "#include \"vci_fd_access.h\"" + CR //header +="#include \"fifo_virtual_copro_wrapper.h\""+ CR;
+ "#include \"vci_ethernet.h\"" + CR if (HWAccelerator.getCoprocType () == 0)
+ "#include \"vci_rttimer.h\"" + CR {
+ "#include \"vci_logger.h\"" + CR header += "#include \"vci_input_engine.h\"" + CR;
+ "#include \"vci_local_crossbar.h\"" + CR2; header += "#include \"papr_slot.h\"" + CR;
header += "#include \"generic_fifo.h\"" + CR;
header = header +"namespace {" + CR header += "#include \"network_io.h\"" + CR;
+"std::vector<std::string> stringArray(" + CR
+" const char *first, ... )" + CR
+"{" + CR
+" std::vector<std::string> ret;" + CR
+" va_list arg;" + CR
+" va_start(arg, first);" + CR
+" const char *s = first;" + CR
+" while(s) {" + CR
+" ret.push_back(std::string(s));" + CR
+" s = va_arg(arg, const char *);" + CR
+" };" + CR
+" va_end(arg);" + CR
+" return ret;" + CR
+"}" + CR2
+"std::vector<int> intArray(" + CR
+" const int length, ... )" + CR
+"{" + CR
+" int i;" + CR
+" std::vector<int> ret;" + CR
+" va_list arg;" + CR
+" va_start(arg, length);" + CR2
+" for (i=0; i<length; ++i) {" + CR
+" ret.push_back(va_arg(arg, int));" + CR
+" };" + CR
+" va_end(arg);" + CR
+" return ret;" + CR
+"}" + CR
+"}" + CR2;
header = header + "using namespace soclib;" + CR + "using common::IntTab;" + CR + "using common::Segment;";
if(TopCellGenerator.avatardd.getNbClusters()==0){
header = header + CR2 + "static common::MappingTable maptab(32, IntTab(8), IntTab(8), 0xfff00000);";
} }
else{ else
header = header + CR2 + "static common::MappingTable maptab(32, IntTab(8,4), IntTab(8,4), 0xfff00000);"; {
if (HWAccelerator.getCoprocType () == 1)
{
header += "#include \"vci_output_engine.h\"" + CR;
}
else
{
header += "#include \"my_hwa.h\"" + CR;
hwas++;
}
} }
return header; // }
} }
header += "#include \"vci_block_device.h\"" + CR
+ "#include \"vci_simhelper.h\"" + CR +
"#include \"vci_fd_access.h\"" + CR +
"#include \"vci_ethernet.h\"" + CR +
"#include \"vci_rttimer.h\"" + CR + "#include \"vci_logger.h\"" +
CR + "#include \"vci_local_crossbar.h\"" + CR2;
header = header + "namespace {" + CR
+ "std::vector<std::string> stringArray(" + CR
+ " const char *first, ... )" + CR
+ "{" + CR
+ " std::vector<std::string> ret;" + CR
+ " va_list arg;" + CR
+ " va_start(arg, first);" + CR
+ " const char *s = first;" + CR
+ " while(s) {" + CR
+ " ret.push_back(std::string(s));" + CR
+
" s = va_arg(arg, const char *);"
+ CR + " };" + CR +
" va_end(arg);" + CR +
" return ret;" + CR +
"}" + CR2 +
"std::vector<int> intArray("
+ CR +
" const int length, ... )"
+ CR + "{" + CR +
" int i;" + CR +
" std::vector<int> ret;"
+ CR +
" va_list arg;"
+ CR +
" va_start(arg, length);"
+ CR2 +
" for (i=0; i<length; ++i) {"
+
CR
+
" ret.push_back(va_arg(arg, int));"
+
CR
+
" };"
+
CR
+
" va_end(arg);"
+ CR + " return ret;" + CR + "}" + CR + "}" + CR2;
header =
header + "using namespace soclib;" + CR +
"using common::IntTab;" + CR + "using common::Segment;";
if (TopCellGenerator.avatardd.getNbClusters () == 0)
{
header =
header + CR2 +
"static common::MappingTable maptab(32, IntTab(8), IntTab(8), 0xfff00000);";
}
else
{
header =
header + CR2 +
"static common::MappingTable maptab(32, IntTab(8,4), IntTab(8,4), 0xfff00000);";
}
return header;
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment