From 8c839e59991a8b0d56fa6a7c6b9fff6ba773d8f2 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sat, 9 May 2020 18:33:20 +0100 Subject: [PATCH] comment maskgen --- src/soc/alu/maskgen.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/soc/alu/maskgen.py b/src/soc/alu/maskgen.py index dd6b9573..89246e0b 100644 --- a/src/soc/alu/maskgen.py +++ b/src/soc/alu/maskgen.py @@ -2,6 +2,15 @@ from nmigen import (Elaboratable, Signal, Module) import math class MaskGen(Elaboratable): + """MaskGen - create a diff mask + + example: x=5 --> a=0b11111 + y=3 --> b=0b00111 + o: 0b11000 + x=2 --> a=0b00011 + y=4 --> b=0b01111 + o: 0b10011 + """ def __init__(self, width): self.width = width self.shiftwidth = math.ceil(math.log2(width)) -- 2.30.2