50main(
int argc,
char ** argv)
54 llvm::LLVMContext ctx;
55 llvm::SMDiagnostic err;
56 auto llvmModule = llvm::parseIRFile(commandLineOptions.InputFile_.to_str(), err, ctx);
57 llvmModule->setSourceFileName(commandLineOptions.OutputFiles_.Dirname().Join(
"jlm_hls").to_str());
60 err.print(argv[0], llvm::errs());
65 auto moduleName = commandLineOptions.InputFile_.base();
79 if (commandLineOptions.ExtractHlsFunction_)
83 llvmToFile(*rvsdgModule, commandLineOptions.OutputFiles_.WithSuffix(
".rest.ll"));
84 llvmToFile(*hlsFunction, commandLineOptions.OutputFiles_.WithSuffix(
".function.ll"));
88 if (commandLineOptions.OutputFormat_
94 auto transformationSequence =
96 transformationSequence->Run(*rvsdgModule, collector);
102 auto output = hls.
ToString(*rvsdgModule);
104 const auto firrtlFile = commandLineOptions.OutputFiles_.WithSuffix(
".fir");
107 const auto outputVerilogFile = commandLineOptions.OutputFiles_.WithSuffix(
".v");
110 std::cerr <<
"The FIRRTL to Verilog conversion failed.\n" << std::endl;
116 vhls.
run(*rvsdgModule),
117 commandLineOptions.OutputFiles_.WithSuffix(
".harness.cpp"));
121 ahls.
run(*rvsdgModule),
122 commandLineOptions.OutputFiles_.WithSuffix(
".harness_axi.cpp"));
126 stringToFile(jhls.
run(*rvsdgModule), commandLineOptions.OutputFiles_.WithSuffix(
".json"));
132 auto transformationSequence =
134 transformationSequence->Run(*rvsdgModule, collector);
138 dhls.
run(*rvsdgModule),
139 commandLineOptions.OutputFiles_.Dirname().Join(
"jlm_hls.dot"));
146 collector.PrintStatistics();