Skip to content

Commit 89893f6

Browse files
committed
feat: support floating point frequency values
1 parent 3cf7500 commit 89893f6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const (
3030
type CompileRequest struct {
3131
Sources map[string]string `json:"sources"`
3232
TopModule string `json:"topModule"`
33-
Freq *int `json:"freq,omitempty"`
33+
Freq *float64 `json:"freq,omitempty"`
3434
Seed *int `json:"seed,omitempty"`
3535
}
3636

@@ -258,7 +258,7 @@ func handleCompile(w http.ResponseWriter, r *http.Request) {
258258
}
259259

260260
// Run nextpnr-ice40
261-
freq := 12
261+
freq := 12.0
262262
if req.Freq != nil {
263263
freq = *req.Freq
264264
}
@@ -270,7 +270,7 @@ func handleCompile(w http.ResponseWriter, r *http.Request) {
270270
nextpnrArgs := []string{
271271
"--pcf-allow-unconstrained",
272272
"--seed", fmt.Sprintf("%d", seed),
273-
"--freq", fmt.Sprintf("%d", freq),
273+
"--freq", fmt.Sprintf("%.3f", freq),
274274
"--package", "sg48",
275275
"--up5k",
276276
"--asc", "output.asc",

0 commit comments

Comments
 (0)