@@ -26,13 +26,134 @@ Currently, the repository supports the following ZKVMs:
2626
2727---
2828
29- ## Usage
29+ # Usage Guide
3030
31- ### Generating report of cycle count of different programs
31+ ## Generating Report of Cycle Counts for Programs
32+
33+ To generate a report of cycle counts for one or more programs, use the following command:
34+
35+ ``` bash
36+ make report PROGRAMS=< PROGRAM_NAME>
37+ ```
38+
39+ ### Notes:
40+ - ** Multiple Programs Supported:** You can specify multiple programs by separating them with commas.
41+ - ** Example Commands:**
42+ ``` bash
43+ make report PROGRAMS=fibonacci
44+ make report PROGRAMS=fibonacci,sha2-chain
45+ ```
46+ - ** Optional Parameter:** If ` PROGRAMS ` is left empty, the report will be generated for all supported programs.
47+
48+ ### Supported Programs
49+ Here is the list of currently supported programs:
50+ - ` fibonacci `
51+ - ` sha2-chain `
52+ - ` schnorr-sig-verify `
53+
54+ ## Generating Report for a Specific ZKVM
55+
56+ To generate profiling data for a specific ZKVM, use the following commands:
57+
58+ ``` bash
59+ make report-< ZkVm>
60+ ```
61+
62+ ### Example Commands:
63+ - For Risc0:
64+ ``` bash
65+ make report-risc0
66+ ```
67+ - For SP1:
68+ ``` bash
69+ make report-sp1
70+ ```
71+ - Similar to the general ` make report ` , you can also pass the ` PROGRAMS ` parameter:
72+ ``` bash
73+ make report-risc0 PROGRAMS=fibonacci
74+ make report-sp1 PROGRAMS=fibonacci,sha2-chain
75+ ```
76+
77+
78+ ## Generating Profile Data
79+
80+ To dump profiling data, set the environment variable ` ZKVM_PROFILING_DUMP=1 ` while running any of the above command.
81+
82+ ``` bash
83+ ZKVM_PROFILING_DUMP=1 make report
84+ ```
85+
86+
87+ ### Viewing SP1 Profile
88+
89+ The profiling data for SP1 can be viewed using [ Samply] ( https://github.com/mstange/samply ) . To view the profile:
90+
91+ ``` bash
92+ samply load < FILENAME> .trace_profile
93+ ```
94+
95+ ### Viewing Risc0 Profile
96+
97+ The profiling data for Risc0 can be viewed using [ pprof] ( https://github.com/google/pprof ) . To view the profile:
98+
99+ ``` bash
100+ go tool pprof -http=127.0.0.1:8000 < FILENAME> .trace_profile
101+ ```
102+
103+ ## Generating Proof for Program
104+
105+ If proof is required, use the following command:
32106
33107``` bash
34- make report
108+ make proof ZKVM= < ZKVM_NAME > PROGRAMS= < PROGRAM_NAME >
35109```
110+ > The proofs are dumped by default
111+
112+ ### Additional Options:
113+ - ** Dump Profiling Data:** To dump proofs, set the environment variable ` ZKVM_PROOF_DUMP=1 ` while running the command:
114+
115+ ## Cleaning Up Generated Data
116+ To clean up generated proofs and profiling data, run:
117+
118+ ``` bash
119+ make prover-clean
120+ ```
121+ This will remove all ` .trace_profile ` and ` .proof ` files from the current directory.
122+
123+ ---
124+
125+ ### Example Workflow
126+ 1 . ** Generate Report for All Programs:**
127+ ``` bash
128+ make report
129+ ```
130+
131+ 2 . ** Generate Report for Specific Programs:**
132+ ``` bash
133+ make report PROGRAMS=fibonacci,sha2-chain
134+ ```
135+
136+ 3 . ** Generate SP1 Report for Specific Programs:**
137+ ``` bash
138+ make report-sp1 PROGRAMS=schnorr-sig-verify
139+ ```
140+
141+ 4 . ** Dump Profiling Data for Risc0:**
142+ ``` bash
143+ ZKVM_PROFILING_DUMP=1 make report-risc0 PROGRAMS=fibonacci
144+ ```
145+
146+ 5 . ** Generate and dump Risc0 Proof**
147+ ``` bash
148+ make proof ZKVM=risc0 PROGRAMS=fibonacci
149+ ```
150+
151+
152+ 5 . ** Clean Up Generated Data:**
153+ ``` bash
154+ make prover-clean
155+ ```
156+
36157
37158---
38159
0 commit comments