https://github.com/yliu-hashed/shimmers-hdl
An HDL based on Swift Macros that turns regular Swift code into Hardware Generators.
https://github.com/yliu-hashed/shimmers-hdl
hardware-design hdl swift-macro synthesis
Last synced: 25 days ago
JSON representation
An HDL based on Swift Macros that turns regular Swift code into Hardware Generators.
- Host: GitHub
- URL: https://github.com/yliu-hashed/shimmers-hdl
- Owner: yliu-hashed
- License: mpl-2.0
- Created: 2025-10-11T01:34:06.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-12-28T21:48:39.000Z (6 months ago)
- Last Synced: 2025-12-31T14:49:58.532Z (6 months ago)
- Topics: hardware-design, hdl, swift-macro, synthesis
- Language: Swift
- Homepage:
- Size: 2.43 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://www.swift.org)
[](https://github.com/yliu-hashed/shimmers-hdl/actions)
[](https://swiftpackageindex.com/yliu-hashed/shimmers-hdl/documentation/shimmers)
Shimmers (Synthesize Hardware In Modular Macro Expansions and Runtime in Swift) is a functional framework for creating circuits.
The principles behind Shimmers are to use functional code in Swift to describe hardware.
In other words, you specify what a circuit does, instead of what it looks like.
Shimmers allows you to describe the behavior of your circuit using regular Swift structs and functions.
Then, Shimmers macros turn them into hardware generators automatically.
For example, the following is a resettable counter:
```swift
@HardwareWire
struct Counter {
var count: UInt8 = 0
@TopLevel(name: "counter", isSequential: true)
mutating func clock(reset: Bool) -> UInt8 {
let lastCount = count
count = reset ? 0 : count &+ amount
return lastCount
}
}
```
## Documentation
Documentations for Shimmers can be accessed on Swift Package Index.
Here is the links for the documentation of each of Shimmers components:
* [Shimmers](https://swiftpackageindex.com/yliu-hashed/shimmers-hdl/documentation)
* [ShimmersCLIWrapper](https://swiftpackageindex.com/yliu-hashed/shimmers-hdl/documentation/shimmerscliwrapper) - A command-line wrapper for any hardware generation code
## Release
Since Shimmers uses Swift Macro through [swift-syntax](https://github.com/swiftlang/swift-syntax), you should use the Exact version Shimmers supports.
Currently, Shimmers only supports Swift 6.2.X.
To use Shimmers in a SwiftPM project, add `shimmers-hdl` as a dependency.
Specifically, add the following to your `Package.swift`.
```swift
dependencies: [
.package(url: "https://github.com/yliu-hashed/shimmers-hdl.git", from: "<#latest-shimmers-version#>"),
],
```
## License
Please see [LICENSE](LICENSE) for more information.