initial commit | complete a draft outline

This commit is contained in:
DarkSharpness
2024-07-09 21:04:36 +08:00
commit 68dd99a826
7 changed files with 388 additions and 0 deletions

40
demo/demo.cpp Normal file
View File

@ -0,0 +1,40 @@
#include "../include/tools"
struct Input {
Wire a;
Wire b;
std::array <Wire, 2> c;
};
struct Output {
Register d;
Register e;
};
struct Content {
Register r;
};
struct MyModule : Input, Output, private Content {
using Tags = SyncTags <Input, Output, Content>;
friend class Visitor;
void demo() {
this->d <= this->a + this->b;
}
};
signed main() {
MyModule m;
m.a = []() { return 1; };
m.b.assign([&]() { return (target_size_t)m.d; });
for (int i = 0 ; i < 10 ; ++i) {
std::cout << m.d << std::endl;
m.demo();
std::cout << m.d << std::endl;
sync_member(m);
}
return 0;
}