Skip to content

Commit dcca66a

Browse files
committed
feat: max frequency and seed configurable
1 parent b0e36a6 commit dcca66a

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

main.go

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ import (
2424
type CompileRequest struct {
2525
Sources map[string]string `json:"sources"`
2626
TopModule string `json:"topModule"`
27+
Freq *int `json:"freq,omitempty"`
28+
Seed *int `json:"seed,omitempty"`
2729
}
2830

2931
type StreamMessage struct {
@@ -246,10 +248,19 @@ func handleCompile(w http.ResponseWriter, r *http.Request) {
246248
}
247249

248250
// Run nextpnr-ice40
251+
freq := 12
252+
if req.Freq != nil {
253+
freq = *req.Freq
254+
}
255+
seed := 42
256+
if req.Seed != nil {
257+
seed = *req.Seed
258+
}
259+
249260
nextpnrArgs := []string{
250261
"--pcf-allow-unconstrained",
251-
"--seed", "10",
252-
"--freq", "48",
262+
"--seed", fmt.Sprintf("%d", seed),
263+
"--freq", fmt.Sprintf("%d", freq),
253264
"--package", "sg48",
254265
"--up5k",
255266
"--asc", "output.asc",

0 commit comments

Comments
 (0)