OpenASIP 2.2
Loading...
Searching...
No Matches
Functions
riscv-tdgen.cc File Reference
#include <iostream>
#include <fstream>
#include <assert.h>
#include "RISCVTDGen.hh"
#include "Machine.hh"
Include dependency graph for riscv-tdgen.cc:

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 

Detailed Description

LLVM target definition generator driver for RISC-V

Author
Kari Hepola 2024 (kari..nosp@m.hepo.nosp@m.la@tu.nosp@m.ni.f.nosp@m.i)
Note
rating: red

Definition in file riscv-tdgen.cc.

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

riscv-tdgen main function.

Generates a RISC-V custom extension target definition file for LLVM

Definition at line 38 of file riscv-tdgen.cc.

38 {
39 std::string outputDir;
40 std::string adfPath;
41
42 // Check if the correct number of arguments is provided
43 if (argc != 5) {
44 std::cout << "Usage: riscv-tdgen" << std::endl
45 << " -o Output directory." << std::endl
46 << " -a ADF path." << std::endl;
47 return EXIT_FAILURE;
48 }
49
50 // Parse command-line arguments
51 for (int i = 1; i < argc; i += 2) {
52 if (std::strcmp(argv[i], "-o") == 0) {
53 outputDir = argv[i + 1];
54 } else if (std::strcmp(argv[i], "-a") == 0) {
55 adfPath = argv[i + 1];
56 }
57 }
58
60 assert(mach != NULL);
61
62 RISCVTDGen tdgen(*mach);
63 tdgen.generateBackend(outputDir);
64 delete mach;
65
66 return EXIT_SUCCESS;
67}
#define assert(condition)
static Machine * loadFromADF(const std::string &adfFileName)
Definition Machine.cc:899

References assert, RISCVTDGen::generateBackend(), and TTAMachine::Machine::loadFromADF().

Here is the call graph for this function: