aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/elab-memtype.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2023-01-07 12:41:40 +0100
committerTristan Gingold <tgingold@free.fr>2023-01-09 06:40:10 +0100
commit8f4b226dd33e46421ed307dbac0cef1e4f6c8489 (patch)
tree5ab39fa0fb6a1c5a02facfa25d97cf115042a51f /src/synth/elab-memtype.adb
parent8c8d9a8bf91d22d4cb7c350a016e0cdcfdae2ef9 (diff)
downloadghdl-8f4b226dd33e46421ed307dbac0cef1e4f6c8489.tar.gz
ghdl-8f4b226dd33e46421ed307dbac0cef1e4f6c8489.tar.bz2
ghdl-8f4b226dd33e46421ed307dbac0cef1e4f6c8489.zip
synth: rework value attribute
Diffstat (limited to 'src/synth/elab-memtype.adb')
-rw-r--r--src/synth/elab-memtype.adb8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/synth/elab-memtype.adb b/src/synth/elab-memtype.adb
index c8234bb2b..8a9babd3d 100644
--- a/src/synth/elab-memtype.adb
+++ b/src/synth/elab-memtype.adb
@@ -42,6 +42,14 @@ package body Elab.Memtype is
return To_U8_Ptr (To_Address (Mem)).all;
end Read_U8;
+ type Char_Ptr is access all Character;
+ function To_Char_Ptr is new Ada.Unchecked_Conversion (Address, Char_Ptr);
+
+ function Read_Char (Mem : Memory_Ptr) return Character is
+ begin
+ return To_Char_Ptr (To_Address (Mem)).all;
+ end Read_Char;
+
procedure Write_I32 (Mem : Memory_Ptr; Val : Ghdl_I32)
is
V : Ghdl_I32;