-
Notifications
You must be signed in to change notification settings - Fork 957
ram: Cross platform testing and support #9991
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 19 commits
cbbbf9c
62711fe
3d95c43
6a8b7a8
582763a
e9d4890
30cc938
be3543f
d495b3b
7c8125a
0dcdb68
132725e
3ca123e
813287e
eb55fa6
1e6c537
4ca740a
57631b6
9d02db1
cab68f4
22fbb07
0cd9418
0b0e823
55f02a6
5b53d5a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,8 +5,10 @@ | |
|
|
||
| #include <array> | ||
| #include <functional> | ||
| #include <map> | ||
| #include <memory> | ||
| #include <string> | ||
| #include <tuple> | ||
| #include <utility> | ||
| #include <vector> | ||
|
maliberty marked this conversation as resolved.
|
||
|
|
||
|
|
@@ -50,6 +52,30 @@ class TritonRoute; | |
|
|
||
| namespace ram { | ||
|
|
||
| enum class PortRoleType | ||
| { | ||
| Clock, | ||
| DataIn, | ||
| DataOut, | ||
| WriteEnable, | ||
| TriEnable, | ||
| Select, // for mux support in future | ||
| Power, | ||
| Ground | ||
| }; | ||
|
|
||
| struct PortRole | ||
| { | ||
| PortRoleType type; | ||
| int index; | ||
|
|
||
| // for map so that keys are comparable | ||
| bool operator<(const PortRole& other) const | ||
| { | ||
| return std::tie(type, index) < std::tie(other.type, other.index); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: no header providing "std::tie" is directly included [misc-include-cleaner] src/ram/include/ram/ram.h:9: - #include <utility>
+ #include <tuple>
+ #include <utility>
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: no header providing "std::tie" is directly included [misc-include-cleaner] src/ram/include/ram/ram.h:10: - #include <utility>
+ #include <tuple>
+ #include <utility> |
||
| } | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In c++20 you can use and get all six operators |
||
| }; | ||
|
|
||
| class RamGen | ||
| { | ||
| public: | ||
|
|
@@ -96,15 +122,10 @@ class RamGen | |
|
|
||
| private: | ||
| void findMasters(); | ||
| std::map<PortRole, std::string> buildPortMap(odb::dbMaster*); | ||
| odb::dbMaster* findMaster(const std::function<bool(sta::LibertyPort*)>& match, | ||
| const char* name); | ||
| odb::dbNet* makeNet(const std::string& prefix, const std::string& name); | ||
| odb::dbInst* makeInst( | ||
| Layout* layout, | ||
| const std::string& prefix, | ||
| const std::string& name, | ||
| odb::dbMaster* master, | ||
| const std::vector<std::pair<std::string, odb::dbNet*>>& connections); | ||
| odb::dbInst* makeInst( | ||
| Cell* cell, | ||
| const std::string& prefix, | ||
|
|
@@ -168,6 +189,13 @@ class RamGen | |
| odb::dbMaster* buffer_cell_{nullptr}; | ||
| odb::dbMaster* tapcell_{nullptr}; | ||
|
|
||
| std::map<PortRole, std::string> storage_ports_; | ||
| std::map<PortRole, std::string> tristate_ports_; | ||
| std::map<PortRole, std::string> inv_ports_; | ||
| std::map<PortRole, std::string> and2_ports_; | ||
| std::map<PortRole, std::string> clock_gate_ports_; | ||
| std::map<PortRole, std::string> buffer_ports_; | ||
|
|
||
| std::vector<odb::dbBTerm*> addr_inputs_; | ||
| std::vector<odb::dbBTerm*> data_inputs_; | ||
| std::vector<std::vector<odb::dbBTerm*>> q_outputs_; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.