From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id DC0E8C013A for ; 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 ; 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 ; 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 ; 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 From: ZmnSCPxj Reply-To: ZmnSCPxj Message-ID: In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: Bitcoin Protocol Discussion 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-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