summaryrefslogtreecommitdiff
path: root/d7/8ba07a4d77a60e4386a8c5169c8883431ee946
blob: 0837ae7610d00fb95e1ab5928beb29ac500d50a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
Return-Path: <ZmnSCPxj@protonmail.com>
Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])
 by lists.linuxfoundation.org (Postfix) with ESMTP id DC0E8C013A
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Sat, 13 Feb 2021 06:10:19 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
 by whitealder.osuosl.org (Postfix) with ESMTP id BE253877CA
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Sat, 13 Feb 2021 06:10:19 +0000 (UTC)
X-Virus-Scanned: amavisd-new at osuosl.org
Received: from whitealder.osuosl.org ([127.0.0.1])
 by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id pCi+xJ453l4q
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Sat, 13 Feb 2021 06:10:18 +0000 (UTC)
X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6
Received: from mail-40141.protonmail.ch (mail-40141.protonmail.ch
 [185.70.40.141])
 by whitealder.osuosl.org (Postfix) with ESMTPS id 18D2487832
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Sat, 13 Feb 2021 06:10:17 +0000 (UTC)
Date: Sat, 13 Feb 2021 06:10:08 +0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com;
 s=protonmail; t=1613196615;
 bh=0PBJ7unP/RpDerQMya2vpaEqBTlKdjAnUjZg5+nGons=;
 h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From;
 b=jDbOsterncPvsnTMQ7cwsd6KK7kuIBW0P+GoNAcPVsNDJzIsKtROLqDx/n/KwkO8b
 XRzz0QCeZxyyO5Vo8/ila76EQSvWqnZyPCzAWJg0jOrF9MyBz9Hm44uVTGd4t0WcFY
 TFowgqGQH1ygcK9j03xeqqfh8T48JQIUygu07HjY=
To: Luke Kenneth Casson Leighton <lkcl@lkcl.net>
From: ZmnSCPxj <ZmnSCPxj@protonmail.com>
Reply-To: ZmnSCPxj <ZmnSCPxj@protonmail.com>
Message-ID: <rYmUVDf2a5W3sUoLcai_8Iy48f-vEUgC8xZ6J7W5A-3hFBQwt4W5LhO1hgc3v0P-3qfij_ocWno852Ig_vc_pn7WiBK8_YcJ4eYpHQTfp8E=@protonmail.com>
In-Reply-To: <puUth0RIvY16I3ghjUiTkIPJQEKETPLZrm2QiiELW8AheIGIin29u5RkztTXIeYIK0xg2UIbsx6m-TpkJU2BvmVyYYr_BYbCdIQSk2t7TkU=@protonmail.com>
References: <CAPweEDx4wH_PG8=wqLgM_+RfTQEUSGfax=SOkgTZhe1FagXF9g@mail.gmail.com>
 <oCNGbVElAQCJ1bEmwLXLzIVec0ZoOA2Ar3vkOc1a0GW12h78bhMi_W4n3pCdDt7hJyPFoMRb0U1T5Wx5uQl4oo6zeQtjKs0MdAXGtvLw1SQ=@protonmail.com>
 <CAPweEDy7Xf3nD1mfyX5MmtsGX=1sd5=gsLosZ=bYavJ0BZyy3g@mail.gmail.com>
 <puUth0RIvY16I3ghjUiTkIPJQEKETPLZrm2QiiELW8AheIGIin29u5RkztTXIeYIK0xg2UIbsx6m-TpkJU2BvmVyYYr_BYbCdIQSk2t7TkU=@protonmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Cc: Bitcoin Protocol Discussion <bitcoin-dev@lists.linuxfoundation.org>
Subject: Re: [bitcoin-dev] Libre/Open blockchain / cryptographic ASICs
X-BeenThere: bitcoin-dev@lists.linuxfoundation.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: Bitcoin Protocol Discussion <bitcoin-dev.lists.linuxfoundation.org>
List-Unsubscribe: <https://lists.linuxfoundation.org/mailman/options/bitcoin-dev>, 
 <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=unsubscribe>
List-Archive: <http://lists.linuxfoundation.org/pipermail/bitcoin-dev/>
List-Post: <mailto:bitcoin-dev@lists.linuxfoundation.org>
List-Help: <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=help>
List-Subscribe: <https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev>, 
 <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=subscribe>
X-List-Received-Date: Sat, 13 Feb 2021 06:10:20 -0000

Good morning Luke,

Another thing we can do with scan mode would be something like the below ma=
sking:

    input CLK, RESET_N;
    input TESTMODE;
    input SCANOUT_INTERNAL;
    output SCANOUT_PAD;

    reg gating;
    wire n_gating =3D gating && TESTMODE;
    always_ff @(posedge CLK, negedge RESET_N) begin
      if (!RESET_N)   gating <=3D 1'b1; /*RESET-HIGH*/
      else            gating <=3D n_gating; end

    assign SCANOUT_PAD =3D SCANOUT_INTERNAL && gating;

The `gating` means that after reset, if we are not in test mode, `gating` b=
ecomes 0 permanently and prevents any scan data from being extracted.
Assuming scan is not used in normal operation (it should not) then inadvert=
ent ESD noise on the `gating` flip-flop would not have an effect.

Output being combinational should be fine as the output is "just" an AND ga=
te, as long as `gating` does not transition from 0->1 (impossible in normal=
 operation, only at reset condition) then glitching is impossible, and when=
 scan is running then `TESTMODE` should not be exited which means `gating` =
should remain high as well, thus output is still glitch-free.

Since the flip-flop resets to 1, and in some technologies I have seen a res=
et-to-0 FF is slightly smaller than a reset-to-1 FF, it might do good to in=
vert the sense of `gating` instead, and use a NOR gate at the output (which=
 might also be smaller than an AND gate, look it up in the technology you a=
re targeting).
On the other hand the above is a tiny circuit already and it is unlikely yo=
u need more than one of it (well for large enough ICs you might want more t=
han one scan chain but still, even the largest ICs we handled never had mor=
e than 8 scan chains, usually just 4 to 6) so overoptimizing this is not ne=
cessary.


Regards,
ZmnSCPxj