14 Commits

Author SHA1 Message Date
Daniel Lubarov
33622c1ec1
Merge pull request #608 from mir-protocol/kernel_size_logs
Have `make_kernel` log the size of each (assembled) file
2022-07-13 13:13:39 -07:00
Daniel Lubarov
a8852946b3 Have make_kernel log the size of each (assembled) file
For now it doesn't log filenames, but we can compare against the list of filenames in `combined_kernel`.

Current output:
```
[DEBUG plonky2_evm::cpu::kernel::assembler] Assembled file size: 0 bytes
[DEBUG plonky2_evm::cpu::kernel::assembler] Assembled file size: 49 bytes
[DEBUG plonky2_evm::cpu::kernel::assembler] Assembled file size: 387 bytes
[DEBUG plonky2_evm::cpu::kernel::assembler] Assembled file size: 27365 bytes
[DEBUG plonky2_evm::cpu::kernel::assembler] Assembled file size: 0 bytes
[DEBUG plonky2_evm::cpu::kernel::assembler] Assembled file size: 11 bytes
[DEBUG plonky2_evm::cpu::kernel::assembler] Assembled file size: 7 bytes
[DEBUG plonky2_evm::cpu::kernel::aggregator::tests] Total kernel size: 27819 bytes
```

This shows that most of our kernel code is from `curve_add.asm`, which makes sense since it invovles a couple uses of the large `inverse` macro.  Thankfully that will be replaced at some point.
2022-07-13 10:53:26 -07:00
wborgeaud
a68d8ff586 Avoid duplicate macros 2022-07-13 18:54:43 +02:00
Daniel Lubarov
8a2a035411 Merge branch 'main' into evm_generation 2022-07-11 09:58:38 -07:00
Daniel Lubarov
58889e7649
Allow constants to be passed from Rust into our assembly (#598)
Roughly like environment variables. So we don't have to declare things like segment IDs twice.
2022-07-08 08:56:46 -07:00
wborgeaud
122188c817 Merge branch 'ec_use_macro_params' into evm_interpreter 2022-07-07 19:17:31 +02:00
wborgeaud
9c4947e0f0 EC ops test 2022-07-07 18:06:24 +02:00
Daniel Lubarov
beb8a90773
Macros with arguments (#595)
* Macros with arguments

See `basic_macros.rs` for an example.

* rename
2022-07-07 08:59:53 -07:00
wborgeaud
ee80fa4a39 Minor 2022-07-05 16:19:23 +02:00
wborgeaud
8873eaba11 Find labels before assembly 2022-07-05 16:11:55 +02:00
Daniel Lubarov
e7b480deaf Begin work on witness generation and kernel bootstrapping 2022-07-01 10:09:57 -07:00
Jacqueline Nabaglo
e3834a5335
Util for assembling EVM code to hex (#586)
This is just for debugging the kernel. It's fully disposable.
2022-06-27 18:08:03 -07:00
Daniel Lubarov
7b75eaa98d
ASM macro support (#580)
* ASM macro support

Also recognize global labels as a PUSH target; previously it only considered local labels.

* macro test
2022-06-25 23:10:08 -07:00
Daniel Lubarov
2e818172f0
Parse and assemble kernel functions (#567)
* Parse and assemble kernel functions

Written in "EVM++" assembly. Later on we will add some priviledged opcodes (in unused opcode ordinals), making it an extension of EVM bytecode.

I don't think there's much of a standard for EVM assembly, but I loosely based the syntax on this [proposal](https://gist.github.com/axic/17ddbbce4738ccf4040d30cbb5de484e).

* PR feedback

* tweaks for consistency

* terminology tweaks

* Update evm/src/cpu/kernel/opcodes.rs

Co-authored-by: Jacqueline Nabaglo <jakub@mirprotocol.org>

* Update evm/src/cpu/kernel/opcodes.rs

Co-authored-by: Jacqueline Nabaglo <jakub@mirprotocol.org>

* Update evm/src/cpu/kernel/opcodes.rs

Co-authored-by: Jacqueline Nabaglo <jakub@mirprotocol.org>

Co-authored-by: Jacqueline Nabaglo <jakub@mirprotocol.org>
2022-06-20 20:32:29 -07:00