-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #97 from Bo-Yuan-Huang/dev
Dev.
- Loading branch information
Showing
30 changed files
with
17,745 additions
and
172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,7 @@ enum AST_UID_EXPR_OP { | |
LSHR, | ||
ADD, | ||
SUB, | ||
MUL, | ||
EQ, | ||
LT, | ||
GT, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/// \file | ||
/// ILA to C target generator.. | ||
|
||
#ifndef ILANG_TARGET_I2C_H__ | ||
#define ILANG_TARGET_I2C_H__ | ||
|
||
#include <ilang/ila/instr_lvl_abs.h> | ||
#include <memory> | ||
#include <unordered_map> | ||
|
||
/// \namespace ilang | ||
namespace ilang { | ||
|
||
/// \brief The calss for converting an ILA model to a C target. | ||
class I2CMngr { | ||
public: | ||
/// Pointer type for normal use of I2CMngr. | ||
typedef std::shared_ptr<I2CMngr> I2CMngrPtr; | ||
|
||
// ------------------------- CONSTRUCTOR/DESTRUCTOR ----------------------- // | ||
/// Default constructor. | ||
I2CMngr(); | ||
/// Default destructor. | ||
~I2CMngr(); | ||
|
||
// ------------------------- HELPERS -------------------------------------- // | ||
/// \brief Create a new I2CMngr. Used for hiding implementation specific type | ||
/// details. | ||
static I2CMngrPtr New(); | ||
|
||
// ------------------------- METHODS -------------------------------------- // | ||
/// \brief Generate a C target of the given ILA model. | ||
/// \param[in] ila The top-level ILA model to generate the C target for. | ||
/// \param[out] C intermediate representation. | ||
void GenerateCTarget(const InstrLvlAbsPtr& ila); | ||
|
||
private: | ||
// ------------------------- MEMBERS -------------------------------------- // | ||
/// A map from visited i_expr id to c_var array index. | ||
std::unordered_map<size_t, size_t> id_var_map_; | ||
|
||
// ------------------------- METHODS -------------------------------------- // | ||
/// Convert constant node to c contant. | ||
void ConvertConst(const ExprPtr& expr) const; | ||
|
||
}; // class I2CMngr | ||
|
||
/// Pointer type for normal use of I2CMngr. | ||
typedef I2CMngr::I2CMngrPtr I2CMngrPtr; | ||
|
||
}; // namespace ilang | ||
|
||
#endif // ILANG_TARGET_I2C_H__ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.