From dd2d45245bc64cb08b9ba7a658ecfbd8417f5924 Mon Sep 17 00:00:00 2001 From: Hans Unzner Date: Fri, 30 Oct 2026 11:44:43 +0100 Subject: [PATCH 1/2] docs: add timing diagram for flipflop component --- src/hal/components/flipflop.comp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/hal/components/flipflop.comp b/src/hal/components/flipflop.comp index 6aaf27ad4f2..0a728e7e92a 100644 --- a/src/hal/components/flipflop.comp +++ b/src/hal/components/flipflop.comp @@ -1,4 +1,23 @@ component flipflop "D type flip-flop"; + +description +""" +.... + ┌─────┐ ┌─────┐ ┌───── +clk: ─────┘ └─────┘ └─────┘ + ────────┐ ┌xxxxxxxxxxxxx +data: └────────────┘xxxxxxxxxxxxx + ┌───────────── +set: ─────────────────────┘ + ─────────────────┐ ┌────┐ +reset: └─────────┘ └── + ┌───────────┐ ┌─────┐ ┌── +out: ─────┘ └───┘ └────┘ + ┌───┐ ┌────┐ +out-not: ─────────────────┘ └─────┘ └── +.... +"""; + pin in bool data_ "data input"; pin in bool clk "clock, rising edge writes data to out"; pin in bool set "when true, force out true"; From cbac7b58050cc39dc3fed6b51a97d811749d6eaf Mon Sep 17 00:00:00 2001 From: Hans Unzner Date: Fri, 30 Oct 2026 12:39:11 +0100 Subject: [PATCH 2/2] flipflop: initialize out-not to 1 --- src/hal/components/flipflop.comp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hal/components/flipflop.comp b/src/hal/components/flipflop.comp index 0a728e7e92a..0b1a23d2b27 100644 --- a/src/hal/components/flipflop.comp +++ b/src/hal/components/flipflop.comp @@ -13,8 +13,8 @@ set: ─────────────────────┘ reset: └─────────┘ └── ┌───────────┐ ┌─────┐ ┌── out: ─────┘ └───┘ └────┘ - ┌───┐ ┌────┐ -out-not: ─────────────────┘ └─────┘ └── + ─────┐ ┌───┐ ┌────┐ +out-not: └───────────┘ └─────┘ └── .... """; @@ -22,8 +22,8 @@ pin in bool data_ "data input"; pin in bool clk "clock, rising edge writes data to out"; pin in bool set "when true, force out true"; pin in bool reset "when true, force out false; overrides set"; -pin io bool out "output"; -pin io bool out-not "inverted output"; +pin io bool out = 0 "output"; +pin io bool out-not = 1 "inverted output"; option data flipflop_data; option period no;