From ad04365e20b4cee992cea4fb1b154c1cd59c141c Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Wed, 21 Oct 2020 09:49:38 +0200 Subject: [PATCH] soc/cores/code_8b10b: add K helper. --- litex/soc/cores/code_8b10b.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/litex/soc/cores/code_8b10b.py b/litex/soc/cores/code_8b10b.py index 74e4e3f83..0d4fc5e24 100644 --- a/litex/soc/cores/code_8b10b.py +++ b/litex/soc/cores/code_8b10b.py @@ -28,6 +28,9 @@ from litex.soc.interconnect import stream # Helpers ------------------------------------------------------------------------------------------ +def K(x, y): + return (y << 5) | x + def disparity(word, nbits): n0 = 0 n1 = 0