Exemple #1
0
 def build_CPP(self, core, sim_root, src_root):
     verilator_root = utils.get_verilator_root()
     if verilator_root is None:
         verilator_root = utils.get_verilator_root()
     args = ['-c']
     args += ['-I' + src_root]
     args += [
         '-I' + os.path.join(src_root, core.sanitized_name, s)
         for s in self.include_dirs
     ]
     args += ['-Iobj_dir']
     args += ['-I' + os.path.join(verilator_root, 'include')]
     args += ['-I' + os.path.join(verilator_root, 'include', 'vltstd')]
     for src_file in core.verilator.src_files:
         pr_info("Compiling " + src_file.name)
         l = utils.Launcher(
             'g++',
             args +
             [os.path.join(src_root, core.sanitized_name, src_file.name)],
             cwd=sim_root,
             stderr=open(os.path.join(sim_root, 'g++.err.log'), 'a'))
         if Config().verbose:
             pr_info("  C++ compilation working dir: " + sim_root)
             pr_info(
                 "  C++ compilation command: g++ " + ' '.join(args) + ' ' +
                 os.path.join(src_root, core.sanitized_name, src_file.name))
         l.run()
Exemple #2
0
 def build_CPP(self, core, sim_root, src_root):
     verilator_root = utils.get_verilator_root()
     if verilator_root is None:
         verilator_root = utils.get_verilator_root()
     args = ['-c']
     args += ['-I'+src_root]
     args += ['-I'+os.path.join(src_root, core, s) for s in self.include_dirs]
     args += ['-I'+os.path.join(verilator_root,'include')]
     args += ['-I'+os.path.join(verilator_root,'include', 'vltstd')]
     for src_file in self.src_files:
         print("Compiling " + src_file)
         l = Launcher('g++', args + [os.path.join(src_root, core, src_file)],
                      cwd=sim_root)
         print(l)
         l.run()
Exemple #3
0
    def build_SysC(self, core, work_root, src_root):
        verilator_root = utils.get_verilator_root()
        args = ['-I.']
        args += ['-MMD']
        args += ['-I'+src_root]
        args += ['-I'+s for s in self.include_dirs]
        args += ['-Iobj_dir']
        args += ['-I'+os.path.join(verilator_root,'include')]
        args += ['-I'+os.path.join(verilator_root,'include', 'vltstd')]  
        args += ['-DVL_PRINTF=printf']
        args += ['-DVM_TRACE=1']
        args += ['-DVM_COVERAGE=0']
        if os.getenv('SYSTEMC_INCLUDE'):
            args += ['-I'+os.getenv('SYSTEMC_INCLUDE')]
        if os.getenv('SYSTEMC'):
            args += ['-I'+os.path.join(os.getenv('SYSTEMC'),'include')]
        args += ['-Wno-deprecated']
        if os.getenv('SYSTEMC_CXX_FLAGS'):
             args += [os.getenv('SYSTEMC_CXX_FLAGS')]
        args += ['-c']
        args += ['-g']

        for src_file in core.verilator.src_files:
            pr_info("Compiling " + src_file.name)
            l = utils.Launcher('g++', args + [os.path.join(src_root, core.sanitized_name, src_file.name)],
                         cwd=work_root,
                         stderr = open(os.path.join(work_root, 'g++.err.log'),'a'))
            if Config().verbose:
                pr_info("  SystemC compilation working dir: " + work_root)
                pr_info("  SystemC compilation command: g++ " + ' '.join(args) + ' ' + os.path.join(src_root, core.sanitized_name, src_file.name))
            l.run()
    def build_SysC(self, core, sim_root, src_root):
        verilator_root = utils.get_verilator_root()
        args = ['-I.']
        args += ['-MMD']
        args += ['-I'+src_root]
        args += ['-I'+s for s in self.include_dirs]
        args += ['-Iobj_dir']
        args += ['-I'+os.path.join(verilator_root,'include')]
        args += ['-I'+os.path.join(verilator_root,'include', 'vltstd')]  
        args += ['-DVL_PRINTF=printf']
        args += ['-DVM_TRACE=1']
        args += ['-DVM_COVERAGE=0']
        if os.getenv('SYSTEMC_INCLUDE'):
            args += ['-I'+os.getenv('SYSTEMC_INCLUDE')]
        if os.getenv('SYSTEMC'):
            args += ['-I'+os.path.join(os.getenv('SYSTEMC'),'include')]
        args += ['-Wno-deprecated']
        if os.getenv('SYSTEMC_CXX_FLAGS'):
             args += [os.getenv('SYSTEMC_CXX_FLAGS')]
        args += ['-c']
        args += ['-g']

        for src_file in core.verilator.src_files:
            pr_info("Compiling " + src_file.name)
            l = utils.Launcher('g++', args + [os.path.join(src_root, core.sanitized_name, src_file.name)],
                         cwd=sim_root,
                         stderr = open(os.path.join(sim_root, 'g++.err.log'),'a'))
            if Config().verbose:
                pr_info("  SystemC compilation working dir: " + sim_root)
                pr_info("  SystemC compilation command: g++ " + ' '.join(args) + ' ' + os.path.join(src_root, core.sanitized_name, src_file.name))
            l.run()
Exemple #5
0
    def build_SysC(self, core, sim_root, src_root):
        verilator_root = utils.get_verilator_root()
        args = ['-I.']
        args += ['-MMD']
        args += ['-I'+src_root]
        args += ['-I'+s for s in self.include_dirs]
        args += ['-Iobj_dir']
        args += ['-I'+os.path.join(verilator_root,'include')]
        args += ['-I'+os.path.join(verilator_root,'include', 'vltstd')]  
        args += ['-DVL_PRINTF=printf']
        args += ['-DVM_TRACE=1']
        args += ['-DVM_COVERAGE=0']
        if os.getenv('SYSTEMC_INCLUDE'):
            args += ['-I'+os.getenv('SYSTEMC_INCLUDE')]
        if os.getenv('SYSTEMC'):
            args += ['-I'+os.path.join(os.getenv('SYSTEMC'),'include')]
        args += ['-Wno-deprecated']
        if os.getenv('SYSTEMC_CXX_FLAGS'):
             args += [os.getenv('SYSTEMC_CXX_FLAGS')]
        args += ['-c']
        args += ['-g']

        for src_file in self.src_files:
            pr_info("Compiling " + src_file)
            l = Launcher('g++', args + [os.path.join(src_root, core, src_file)],
                         cwd=sim_root)
            print(l)
            l.run()
Exemple #6
0
 def build_CPP(self, core, sim_root, src_root):
     verilator_root = utils.get_verilator_root()
     if verilator_root is None:
         verilator_root = utils.get_verilator_root()
     args = ['-c']
     args += ['-I'+src_root]
     args += ['-I'+os.path.join(src_root, core, s) for s in self.include_dirs]
     args += ['-I'+os.path.join(verilator_root,'include')]
     args += ['-I'+os.path.join(verilator_root,'include', 'vltstd')]
     for src_file in self.src_files:
         pr_info("Compiling " + src_file)
         l = Launcher('g++', args + [os.path.join(src_root, core, src_file)],
                      cwd=sim_root,
                      stderr = open(os.path.join(sim_root, 'g++.err.log'),'a'))
         if Config().verbose:
             pr_info("  C++ compilation working dir: " + sim_root)
             pr_info("  C++ compilation command: g++ " + ' '.join(args) + ' ' + os.path.join(src_root, core, src_file))
         l.run()
Exemple #7
0
 def build_CPP(self, core, sim_root, src_root):
     verilator_root = utils.get_verilator_root()
     if verilator_root is None:
         verilator_root = utils.get_verilator_root()
     args = ["-c"]
     args += ["-I" + src_root]
     args += ["-I" + os.path.join(src_root, core, s) for s in self.include_dirs]
     args += ["-I" + os.path.join(verilator_root, "include")]
     args += ["-I" + os.path.join(verilator_root, "include", "vltstd")]
     for src_file in self.src_files:
         pr_info("Compiling " + src_file)
         l = Launcher(
             "g++",
             args + [os.path.join(src_root, core, src_file)],
             cwd=sim_root,
             stderr=open(os.path.join(sim_root, "g++.err.log"), "a"),
         )
         if Config().verbose:
             pr_info("  C++ compilation working dir: " + sim_root)
             pr_info(
                 "  C++ compilation command: g++ " + " ".join(args) + " " + os.path.join(src_root, core, src_file)
             )
         l.run()
Exemple #8
0
    def build_SysC(self, core, sim_root, src_root):
        verilator_root = utils.get_verilator_root()
        args = ["-I."]
        args += ["-MMD"]
        args += ["-I" + src_root]
        args += ["-I" + s for s in self.include_dirs]
        args += ["-Iobj_dir"]
        args += ["-I" + os.path.join(verilator_root, "include")]
        args += ["-I" + os.path.join(verilator_root, "include", "vltstd")]
        args += ["-DVL_PRINTF=printf"]
        args += ["-DVM_TRACE=1"]
        args += ["-DVM_COVERAGE=0"]
        if os.getenv("SYSTEMC_INCLUDE"):
            args += ["-I" + os.getenv("SYSTEMC_INCLUDE")]
        if os.getenv("SYSTEMC"):
            args += ["-I" + os.path.join(os.getenv("SYSTEMC"), "include")]
        args += ["-Wno-deprecated"]
        if os.getenv("SYSTEMC_CXX_FLAGS"):
            args += [os.getenv("SYSTEMC_CXX_FLAGS")]
        args += ["-c"]
        args += ["-g"]

        for src_file in self.src_files:
            pr_info("Compiling " + src_file)
            l = Launcher(
                "g++",
                args + [os.path.join(src_root, core, src_file)],
                cwd=sim_root,
                stderr=open(os.path.join(sim_root, "g++.err.log"), "a"),
            )
            if Config().verbose:
                pr_info("  SystemC compilation working dir: " + sim_root)
                pr_info(
                    "  SystemC compilation command: g++ "
                    + " ".join(args)
                    + " "
                    + os.path.join(src_root, core, src_file)
                )
            l.run()