generated from cotes2020/chirpy-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
265 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--- | ||
layout: post | ||
title: EDA tools | ||
date: 2024-11-15 20:34 +0800 | ||
categories: [tools, EDA工具] | ||
tags: [] | ||
img_path: /assets/img/learn/ | ||
--- | ||
|
||
## vivado | ||
[AXI VIP的简单使用](https://icode.best/i/36088746158033) | ||
|
||
|
||
|
||
|
||
|
||
|
||
## Verdi | ||
|
||
- 要查看二维数组的值,需要在Makefile及仿真的tb中添加 | ||
[使用VCS观察Verilog二维数组仿真值的方法](https://zhuanlan.zhihu.com/p/119326286) | ||
|
||
```sh | ||
“+v2k(VCS和Verdi中都要加),一个case如下”: | ||
make:clean com sim | ||
all:clean com sim verdi | ||
com: | ||
vcs -full64 -sverilog -debug_acc+all -timescale=1ns/10ps -f file.list -l coml.log -fsdb +define+FSDB +vc +v2k | ||
sim: | ||
./simv -l sim.log | ||
verdi: | ||
verdi -f file.list -ssf sim.fsdb -nologo +v2k & | ||
clean: | ||
rm -rf crsc *.log *.key *simv* *.vpd *DVE* rm -rf verdilog *.fsdb *.conf | ||
|
||
“tb中需要有”: | ||
initial begin | ||
$fsdbDumpfile("sim.fsdb"); | ||
$fsdbDumpvars; | ||
$fsdbDumpMDA(); //这个要放在最后 | ||
#10000 $finish; | ||
end | ||
``` | ||
|
||
- 添加Mark | ||
|
||
你可以shift+m,出现添加mark的窗口,输入mark的名称和时间点,close即可。 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
--- | ||
layout: post | ||
title: Digit-Serial 脉动结构(Systolic)的乘法器 | ||
date: 2024-11-18 20:19 +0800 | ||
categories: [项目学习, 算法] | ||
tags: [] | ||
math: true | ||
img_path: /assets/img/learn/ | ||
--- | ||
|
||
## 1. 概念的介绍 | ||
对于有限域 $GF(2^n)$,设其模多项式为 | ||
|
||
$$ | ||
m(x) = x^n + \sum_{i=0}^{n-1} m_i x^i \quad (m_i \in \{0,1\}), | ||
$$ | ||
|
||
则满足以下公式: | ||
|
||
$$ | ||
x^n \mod m(x) = [m(x) - x^n] = \sum_{i=0}^{n-1} m_i x^i | ||
$$ | ||
|
||
设有限域 $GF(2^n)$上的任意两个多项式 A(x)、 B(x) 以及既约多项式 G(x) 分别为: | ||
|
||
$$ | ||
A(x) = a_{n-1}x^{n-1} + a_{n-2}x^{n-2} + \cdots + a_1x + a_0, | ||
$$ | ||
|
||
$$ | ||
B(x) = b_{n-1}x^{n-1} + b_{n-2}x^{n-2} + \cdots + b_1x + b_0, | ||
$$ | ||
|
||
$$ | ||
G(x) = x^n + r(x) = x^n + g_{n-1}x^{n-1} + g_{n-2}x^{n-2} + \cdots + g_1x + g_0, | ||
$$ | ||
|
||
其中,$a_i, b_i, g_i in GF(2^n)$。 | ||
|
||
设 A(x) 与 B(x) 的乘积 P(x)为: | ||
|
||
$$ | ||
P(x) = [A(x) \cdot B(x)] \mod G(x) = p_{n-1}x^{n-1} + p_{n-2}x^{n-2} + \cdots + p_1x + p_0, | ||
$$ | ||
|
||
则: | ||
|
||
$$ | ||
P(x) = A(x) \cdot \left(b_{n-1}x^{n-1} + b_{n-2}x^{n-2} + \cdots + b_1x + b_0 \right) \mod G(x). | ||
$$ | ||
|
||
展开可得: | ||
|
||
$$ | ||
P(x) = \left\{\cdots \left[A(x) \cdot b_{n-1}x^{n-1} \mod G(x) + A(x) \cdot b_{n-2}x^{n-2} \mod G(x)\right] \cdots + A(x) \cdot b_1x \mod G(x) + A(x) \cdot b_0 \right\}. | ||
$$ | ||
|
||
由上述公式可知,有限域 $GF(2^n)$上的多项式运算可以通过选代完成,选代单元为: | ||
|
||
$$ | ||
T^{(i)} = T^{(i-1)} \cdot x \mod G(x) + b_{n-i}A(x), \quad 0 < i \leq n, | ||
$$ | ||
|
||
其中: | ||
|
||
$$ | ||
T^{(0)} = 0, \quad T^{(n)} = P(x). | ||
$$ | ||
|
||
实际上,选代单元 $T^{(i)}$ 也是有限域 $GF(2^n)$ 中的多项式元素,令: | ||
|
||
$$ | ||
T^{(i)} = t_{n-1}^{(i)}x^{n-1} + t_{n-2}^{(i)}x^{n-2} + \cdots + t_1^{(i)}x + t_0^{(i)}, | ||
$$ | ||
|
||
则 | ||
|
||
$$ | ||
T^{(i-1)} = t_{n-1}^{(i-1)}x^{n-1} + t_{n-2}^{(i-1)}x^{n-2} + \cdots + t_1^{(i-1)}x + t_0^{(i-1)}. | ||
$$ | ||
|
||
由选代关系可以推得: | ||
|
||
$$ | ||
T^{(i)} = T^{(i-1)} \cdot x \mod G(x) + b_{n-i}A(x) | ||
$$ | ||
|
||
展开为: | ||
|
||
$$ | ||
T^{(i)} = \left[ t_{n-1}^{(i-1)}x^{n-1} + \cdots + t_1^{(i-1)}x + t_0^{(i-1)} \right]x \mod G(x) + b_{n-i}A(x) | ||
$$ | ||
|
||
即: | ||
|
||
$$ | ||
T^{(i)} = \left[ t_{n-1}^{(i-1)}x^n + \cdots + t_1^{(i-1)}x^2 + t_0^{(i-1)}x \right] \mod G(x) + b_{n-i}A(x). | ||
$$ | ||
|
||
由此可得: | ||
|
||
$$ | ||
T^{(i)} = t_{n-1}^{(i-1)} \cdot r(x) + t_{n-2}^{(i-1)}x^{n-1} + \cdots + t_1^{(i-1)}x^2 + t_0^{(i-1)}x + b_{n-i}A(x). | ||
$$ | ||
|
||
分项展开为: | ||
|
||
$$ | ||
T^{(i)} = \left[t_{n-1}^{(i-1)}g_{n-1} + t_{n-2}^{(i-1)} + b_{n-i}a_{n-1}\right] \cdot x^{n-1} | ||
$$ | ||
|
||
$$ | ||
+ \left[t_{n-1}^{(i-1)}g_{n-2} + t_{n-3}^{(i-1)} + b_{n-i}a_{n-2}\right] \cdot x^{n-2} | ||
$$ | ||
|
||
$$ | ||
+ \cdots | ||
$$ | ||
|
||
$$ | ||
+ \left[t_{n-1}^{(i-1)}g_1 + t_0^{(i-1)} + b_{n-i}a_1\right] \cdot x^1 | ||
$$ | ||
|
||
$$ | ||
+ \left[t_{n-1}^{(i-1)}g_0 + b_{n-i}a_0\right] \cdot x^0. | ||
$$ | ||
|
||
即: | ||
|
||
$$ | ||
t_j^{(i)} = t_{n-1}^{(i-1)}g_j + t_{j-1}^{(i-1)} + b_{n-i}a_j, | ||
$$ | ||
|
||
其中 $1 \leq i \leq n$ 且 $t_i^{(0)} = 0, t_{-1}^{(i)} = 0$ | ||
|
||
则 $A(x)$ 与 $B(x)$ 的乘积 $P(x)$ 为: | ||
|
||
$$ | ||
P(x) = T^{(n)} = \sum_{j=0}^{n-1} t_j^{(n)}x^j. | ||
$$ | ||
|
||
考虑到上述各参数均处于有限域$GF(2^n)$中,因此其均为0或1,上式中乘法可以用与门实现,加法可以用异或门实现 | ||
|
||
![cell_t]({{ page.img_path }}cell_t.png){: width="972" height="589" } | ||
![cell]({{ page.img_path }}cell.png){: width="972" height="589" } | ||
|
||
假设n为8, Bit-Parallel阵列形式如下,这是一种并行度最高的架构。 | ||
|
||
![m8]({{ page.img_path }}m8.png){: width="972" height="589" } | ||
|
||
Digit-Serial阵列在上述Bit-Parallel阵列的基础上降低了并行度,以此换得较低的资源占用率 | ||
![compress1]({{ page.img_path }}compress1.png){: width="972" height="589" } | ||
![compress2]({{ page.img_path }}compress2.png){: width="972" height="589" } | ||
![compress3]({{ page.img_path }}compress3.png){: width="972" height="589" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { codeToHtml } from 'https://esm.sh/[email protected]'; | ||
|
||
window.renderShiki = async function (elementId, code, lang = 'javascript', theme = 'rose-pine') { | ||
const element = document.getElementById(elementId); | ||
if (!element) { | ||
console.error(`Element with ID "${elementId}" not found.`); | ||
return; | ||
} | ||
element.innerHTML = await codeToHtml(code, { lang, theme }); | ||
}; |