aboutsummaryrefslogtreecommitdiffhomepage
path: root/pyecsca/codegen/hal/host
diff options
context:
space:
mode:
authorJ08nY2019-11-25 17:45:35 +0100
committerJ08nY2019-11-25 17:45:35 +0100
commit8a56c7a95e662862cfe78b834ccb091e95d5372f (patch)
tree1fd57480b7fc681f00c0bfb6c0e5cfea86762f87 /pyecsca/codegen/hal/host
parentc8d0bff46001bd5636825c5b0bb4c896cb34a4e6 (diff)
downloadpyecsca-codegen-8a56c7a95e662862cfe78b834ccb091e95d5372f.tar.gz
pyecsca-codegen-8a56c7a95e662862cfe78b834ccb091e95d5372f.tar.zst
pyecsca-codegen-8a56c7a95e662862cfe78b834ccb091e95d5372f.zip
Add libtommath, HOST build, and a simple PRNG.
Diffstat (limited to 'pyecsca/codegen/hal/host')
-rw-r--r--pyecsca/codegen/hal/host/Makefile.host10
-rw-r--r--pyecsca/codegen/hal/host/host_hal.c2
-rw-r--r--pyecsca/codegen/hal/host/host_hal.h14
-rw-r--r--pyecsca/codegen/hal/host/uart.c7
-rw-r--r--pyecsca/codegen/hal/host/uart.h13
5 files changed, 46 insertions, 0 deletions
diff --git a/pyecsca/codegen/hal/host/Makefile.host b/pyecsca/codegen/hal/host/Makefile.host
new file mode 100644
index 0000000..933c899
--- /dev/null
+++ b/pyecsca/codegen/hal/host/Makefile.host
@@ -0,0 +1,10 @@
+VPATH += :$(HALPATH)/host
+SRC += uart.c host_hal.c
+EXTRAINCDIRS += $(HALPATH)/host
+
+CC = gcc
+OBJCOPY = objcopy
+OBJDUMP = objdump
+SIZE = size
+AR = ar rcs
+NM = nm \ No newline at end of file
diff --git a/pyecsca/codegen/hal/host/host_hal.c b/pyecsca/codegen/hal/host/host_hal.c
new file mode 100644
index 0000000..fe71aab
--- /dev/null
+++ b/pyecsca/codegen/hal/host/host_hal.c
@@ -0,0 +1,2 @@
+
+void platform_init(void) {} \ No newline at end of file
diff --git a/pyecsca/codegen/hal/host/host_hal.h b/pyecsca/codegen/hal/host/host_hal.h
new file mode 100644
index 0000000..b78172c
--- /dev/null
+++ b/pyecsca/codegen/hal/host/host_hal.h
@@ -0,0 +1,14 @@
+#ifndef HOST_HAL_H_
+#define HOST_HAL_H_
+
+#include "uart.h"
+
+#define trigger_setup()
+#define trigger_high()
+#define trigger_low()
+
+#define init_uart init_uart0
+#define putch output_ch_0
+#define getch input_ch_0
+
+#endif //HOST_HAL_H_
diff --git a/pyecsca/codegen/hal/host/uart.c b/pyecsca/codegen/hal/host/uart.c
new file mode 100644
index 0000000..3931d6d
--- /dev/null
+++ b/pyecsca/codegen/hal/host/uart.c
@@ -0,0 +1,7 @@
+#include "uart.h"
+
+void init_uart0(void) {}
+
+char input_ch_0(void) { return getchar(); }
+
+void output_ch_0(char data) { putchar(data); } \ No newline at end of file
diff --git a/pyecsca/codegen/hal/host/uart.h b/pyecsca/codegen/hal/host/uart.h
new file mode 100644
index 0000000..d6063bc
--- /dev/null
+++ b/pyecsca/codegen/hal/host/uart.h
@@ -0,0 +1,13 @@
+#ifndef UART_H_
+#define UART_H_
+
+#include <stdio.h>
+
+
+void init_uart0(void);
+
+char input_ch_0(void);
+
+void output_ch_0(char data);
+
+#endif //UART_H_ \ No newline at end of file