diff --git a/docs/Generators/SHA3.rst b/docs/Generators/SHA3.rst index ca3d1b03..cfd4be7e 100644 --- a/docs/Generators/SHA3.rst +++ b/docs/Generators/SHA3.rst @@ -68,3 +68,18 @@ on which available execution unit they should be run. Once the message is fully hashed, the hash is written to memory with a simple state machine. + +Using a SHA3 Accelerator +------------------------ +Since the SHA3 accelerator is designed as a RoCC accelerator, +it can be mised into a Rocket or BOOM core by overriding the +BuildRoCC key. The configuration mixin is defined in the SHA3 +generator. An example configuration highlighting the use of +this mixin is shown here: + +.. literalinclude:: ../../generators/example/src/main/scala/RocketConfigs.scala + :language: scala + :start-after: DOC include start: Sha3Rocket + :end-before: DOC include end: Sha3Rocket + + diff --git a/generators/example/src/main/scala/RocketConfigs.scala b/generators/example/src/main/scala/RocketConfigs.scala index 2275549f..803aaa08 100644 --- a/generators/example/src/main/scala/RocketConfigs.scala +++ b/generators/example/src/main/scala/RocketConfigs.scala @@ -104,6 +104,7 @@ class GB1MemoryRocketConfig extends Config( new freechips.rocketchip.subsystem.WithNBigCores(1) ++ new freechips.rocketchip.system.BaseConfig) +// DOC include start: Sha3Rocket class Sha3RocketConfig extends Config( new WithTop ++ new WithBootROM ++ @@ -111,6 +112,7 @@ class Sha3RocketConfig extends Config( new sha3.WithSha3Accel ++ // add SHA3 rocc accelerator new freechips.rocketchip.subsystem.WithNBigCores(1) ++ new freechips.rocketchip.system.BaseConfig) +// DOC include end: Sha3Rocket // DOC include start: InitZeroRocketConfig class InitZeroRocketConfig extends Config(