diff --git a/docs/tools/data-gen.md b/docs/tools/data-gen.md index 9b0d531ba3..744a8d8afe 100644 --- a/docs/tools/data-gen.md +++ b/docs/tools/data-gen.md @@ -1,17 +1,22 @@ # Data Gen -Data Gen is a tool that can generate a memory json from a Calyx file. It reads -the Calyx file and generates an entry in the json for each cell marked with the -`@external` attribute. Currently, there are two types of number representation formats that can be generated as the data for the memory json: 1) unsigned 32 bit bitnums all equal to 0 and 2) signed, 32 bit fixed point numbers with `frac_width` = 16, and the data is randomly generated. +Data Gen is a tool that can automatically generate a memory .json file from a Calyx file. +It reads the Calyx file and generates an entry in the json for each cell marked with the +`@external` attribute. + +Currently, there are two parameters you can specify: 1) whether the data should be fixed point (integer is default) and 2) whether data should be randomly generated (0 is the default). +This tool can only generate fixed point values that have 16 bits for the fraction. ## How to Run -The following command can be run to generate unsigned, 32-bit zeroes: +The following command can be run to generate unsigned integer zeroes: `cargo run -p data_gen -- ` To generate random fixed point numbers, run: -`cargo run -p data_gen -- -f true` +`cargo run -p data_gen -- -f true -r true` -It will print the json in the command line +It will print the json in the command line. ## Current Limitations -As you can see, the tool is right now pretty limited, because it only supports 2 different representations of numbers. What if you want to generate random, 8 bit, unsigned ints in your memory? Data Gen currently wouldn't support that. Ideally, we would want each Calyx memory cell to have its own attribute(s) which can hold information about what type of number representation format the memory wants. This [github issue](https://github.com/calyxir/calyx/issues/1163) goes into more detail about future improvements for the tool. \ No newline at end of file +As you can see, the tool is right now pretty limited. +For example, the fixed point values must be 16 bit, and the json generated only supports one memory type (for example, if you wanted some of the memories to be fixed point and others to be integers, this tool does not support that). +Ideally, we would want each Calyx memory cell to have its own attribute(s) which can hold information about what type of number representation format the memory wants. This [github issue](https://github.com/calyxir/calyx/issues/1163) goes into more detail about future improvements for the tool. \ No newline at end of file