def run(self): builder = build.Builder(self.project, os.path.join("/tmp", self.project.get_name() + ".h")) build.write_header_file(builder) builder.write_to_file() tester = base.tester.Tester() tester.prepare_writer = self.prepare_writer tester.args = [ "-I", os.path.join(paths.KAIRA_ROOT, paths.CAILIE_INCLUDE_DIR), "-I", self.project.root_directory ] if self.project.get_build_with_octave(): import ptp # To avoid cyclic import tester.args += [ "-I", os.path.join(paths.KAIRA_ROOT, paths.CAOCTAVE_INCLUDE_DIR) ] tester.args += ptp.get_config("Octave", "INCFLAGS").split() if self.project.build_target == "simrun": tester.args += [ "-I", os.path.join(paths.KAIRA_ROOT, paths.CASIMRUN_INCLUDE_DIR) ] tester.args += self.project.get_build_option("CFLAGS").split() tester.run() if tester.stderr: raise utils.PtpException(tester.stderr) for t in self.types.values(): t.add_checks(tester) for check in self.checks: tester.add(check) check = tester.run() if check is not None: check.throw_exception()
def write_library_header_file(builder): build.write_header_file(builder, close_guard=False) builder.emptyline() builder.line("void calib_init(int argc, char **argv);") for p in builder.project.get_parameters(): builder.line("void set_parameter_{0.name}({0.type} {0.name});", p) for net in builder.project.nets: builder.line("void {0}({1});", net.name, get_library_function_declaration(net)) build.write_header_file_close_guard(builder)
def run(self): builder = build.Builder(self.project, os.path.join("/tmp", self.project.get_name() + ".h")) build.write_header_file(builder) builder.write_to_file() tester = base.tester.Tester() tester.prepare_writer = self.prepare_writer tester.args = [ "-I", os.path.join(paths.KAIRA_ROOT, paths.CAILIE_INCLUDE_DIR), "-I", self.project.root_directory ] if self.project.get_build_with_octave(): import ptp # To avoid cyclic import tester.args += [ "-I", os.path.join(paths.KAIRA_ROOT, paths.CAOCTAVE_INCLUDE_DIR) ] tester.args += ptp.get_config("Octave", "INCFLAGS").split() if self.project.build_target == "simrun": tester.args += [ "-I", os.path.join(paths.KAIRA_ROOT, paths.CASIMRUN_INCLUDE_DIR) ] tester.args += self.project.get_build_option("CFLAGS").split() tester.run() if tester.stderr: raise utils.PtpException(tester.stderr) for t in self.types.values(): t.add_checks(tester) for expr, decls, return_type, source, message in self.expressions: check = CheckStatement(expr + ";", decls, source=source) if message: check.own_message = message tester.add(check) check = CheckStatement("return (" + expr + ");", decls, return_type, source) if message: check.own_message = message else: check.own_message = "Invalid type of expression" tester.add(check) check = tester.run() if check is not None: check.throw_exception()
def run(self): builder = build.Builder(self.project, os.path.join("/tmp", self.project.get_name() + ".h")) build.write_header_file(builder) builder.write_to_file() tester = base.tester.Tester() tester.prepare_writer = self.prepare_writer tester.args = [ "-I", os.path.join(paths.KAIRA_ROOT, paths.CAILIE_INCLUDE_DIR), "-I", self.project.root_directory, ] if self.project.get_build_with_octave(): import ptp # To avoid cyclic import tester.args += ["-I", os.path.join(paths.KAIRA_ROOT, paths.CAOCTAVE_INCLUDE_DIR)] tester.args += ptp.get_config("Octave", "INCFLAGS").split() if self.project.build_target == "simrun": tester.args += ["-I", os.path.join(paths.KAIRA_ROOT, paths.CASIMRUN_INCLUDE_DIR)] tester.args += self.project.get_build_option("CFLAGS").split() tester.run() if tester.stderr: raise utils.PtpException(tester.stderr) for t in self.types.values(): t.add_checks(tester) for check in self.checks: tester.add(check) check = tester.run() if check is not None: check.throw_exception()
def write_header_file(self, directory): builder = build.Builder(self.project, self.get_filename(directory, ".h")) build.write_header_file(builder) builder.write_to_file()
def get_header(self): builder = build.Builder(self.project) build.write_header_file(builder) return builder.get_string()