|
|
# Fixed
|
|
|
|
|
|
## 简介
|
|
|
|
|
|
Fixed circuit是在电路初始化阶段预先向fixed_table填入一些cell数据,在后续电路运行过程中进行lookup查表操作;
|
... | ... | @@ -59,28 +61,28 @@ pub enum Tag { |
|
|
|
|
|
###### Fixed电路为不同的场景生成多行Row数据,将它填入Fixed_table表后示例如下:
|
|
|
|
|
|
| tag | value_0 | value_1 | value_2 |
|
|
|
----|----|----|-----|
|
|
|
| And | 0 | 0 | 0 |
|
|
|
| And | 0 | 1 | 0 |
|
|
|
| And | ...| ...| ...|
|
|
|
| And | 255 | 0 | 0 |
|
|
|
| And | 255 | 1 | 1 |
|
|
|
| Or | 0 | 0 | 0 |
|
|
|
| Or | 0 | 1 | 1 |
|
|
|
| Or | ...| ...| ...|
|
|
|
| Or | 255 | 0 | 255 |
|
|
|
| Or | 255 | 1 | 255 |
|
|
|
| Bytecode | MLOAD | 0 | 0 |
|
|
|
| Bytecode | PUSH1 | 1 | 0|
|
|
|
| Bytecode | PUSH30 | 30 | 1|
|
|
|
| Bytecode | ...| ...| ...|
|
|
|
| U16 | 256 (不必从0开始) | U10_TAG | 1|
|
|
|
| U16 | ... | U10_TAG| ... |
|
|
|
| U16 | 1279 | U10_TAG| 1024|
|
|
|
| U16 | 1280 | | |
|
|
|
| U16 | .... | | |
|
|
|
| U16 | 65535 | | |
|
|
|
| tag | value_0 | value_1 | value_2 |
|
|
|
| -------- | ----------------- | ------- | ------- |
|
|
|
| And | 0 | 0 | 0 |
|
|
|
| And | 0 | 1 | 0 |
|
|
|
| And | ... | ... | ... |
|
|
|
| And | 255 | 0 | 0 |
|
|
|
| And | 255 | 1 | 1 |
|
|
|
| Or | 0 | 0 | 0 |
|
|
|
| Or | 0 | 1 | 1 |
|
|
|
| Or | ... | ... | ... |
|
|
|
| Or | 255 | 0 | 255 |
|
|
|
| Or | 255 | 1 | 255 |
|
|
|
| Bytecode | MLOAD | 0 | 0 |
|
|
|
| Bytecode | PUSH1 | 1 | 0 |
|
|
|
| Bytecode | PUSH30 | 30 | 1 |
|
|
|
| Bytecode | ... | ... | ... |
|
|
|
| U16 | 256 (不必从0开始) | U10_TAG | 1 |
|
|
|
| U16 | ... | U10_TAG | ... |
|
|
|
| U16 | 1279 | U10_TAG | 1024 |
|
|
|
| U16 | 1280 | | |
|
|
|
| U16 | .... | | |
|
|
|
| U16 | 65535 | | |
|
|
|
|
|
|
## 使用
|
|
|
|
... | ... | |