From aca7b8f57370ccdba41577c845361800ae6f8d39 Mon Sep 17 00:00:00 2001 From: ymherklotz Date: Fri, 22 Jan 2021 17:23:49 +0000 Subject: deploy: 1ff8b1c7a3f3e37809e9ac8c1e21d50df270696a --- docs/using-vericert/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/using-vericert') diff --git a/docs/using-vericert/index.html b/docs/using-vericert/index.html index 043db1e..c97296d 100644 --- a/docs/using-vericert/index.html +++ b/docs/using-vericert/index.html @@ -1,6 +1,6 @@ Using Vericert | Vericert +void matrix_multiply(int first[2][2], int second[2][2], int multiply[2][2]) { int sum = 0; for (int c = 0; c < 2; c++) { for (int d = 0; d < 2; d++) { for (int k = 0; k < 2; k++) { sum = sum + first[c][k]*second[k][d]; } multiply[c][d] = sum; sum = 0; } } } int main() { int f[2][2] = {{1, 2}, {3, 4}}; int s[2][2] = {{5, 6}, {7, 8}}; int m[2][2] = {{0, 0}, {0, 0}}; matrix_multiply(f, s, m); return m[1][1]; } It can be compiled using the following command, assuming that vericert is somewhere on the path.">Using Vericert | Vericert
Using Vericert

Vericert can be used to translate a subset of C into Verilog. As a simple example, consider the following C file (main.c):

void matrix_multiply(int first[2][2], int second[2][2], int multiply[2][2]) {
-- 
cgit