Melissa Jost has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/53030 )

Change subject: dev,arch: Added LupioRNG to LupVBoard
......................................................................

dev,arch: Added LupioRNG to LupVBoard

This adds the LupioRNG device to our LupVBoard, adding
random number generation capability to this RISC-V
based system.

Change-Id: I89c78c119a46cc7b056005d8abef16b1816ee4c4
---
M src/python/gem5/components/boards/lupv_board.py
1 file changed, 38 insertions(+), 2 deletions(-)



diff --git a/src/python/gem5/components/boards/lupv_board.py b/src/python/gem5/components/boards/lupv_board.py
index f205b98..8e35538 100644
--- a/src/python/gem5/components/boards/lupv_board.py
+++ b/src/python/gem5/components/boards/lupv_board.py
@@ -48,6 +48,7 @@
     Plic,
     Uart8250,
     Terminal,
+    LupioRNG,
     LupioRTC,
     LupV,
     AddrRange,
@@ -97,7 +98,7 @@

         # Initialize all the devices that we want to use on this board
         # Interrupt IDS for PIC Device
-        self._int_ids = { 'UART': 1, 'DISK': 2}
+        self._int_ids = { 'UART': 1, 'DISK': 2, 'RNG': 3}

         # CLINT
         self.clint = Clint(pio_addr=0x2000000)
@@ -111,6 +112,13 @@
             uart_int_id = self._int_ids['UART']
         )

+        # LUPIO RNG
+        self.lupio_rng = LupioRNG(
+            pio_addr=0x20005000,
+            platform = self.lupv,
+            int_id = self._int_ids['RNG']
+        )
+
         # LUPIO RTC
         self.lupio_rtc = LupioRTC(pio_addr=0x20004000)

@@ -128,7 +136,8 @@

         pic_srcs = [
             self._int_ids['UART'],
-            self._int_ids['DISK']
+            self._int_ids['DISK'],
+            self._int_ids['RNG']
         ]
         self.pic.n_contexts = self.processor.get_num_cores() * 2
         self.pic.n_src = max(pic_srcs) + 1
@@ -150,6 +159,7 @@
         self._off_chip_devices = [
             self.uart,
             self.disk,
+            self.lupio_rng,
             self.lupio_rtc
         ]

@@ -383,6 +393,19 @@
         disk_node.appendCompatible(["virtio,mmio"])
         soc_node.append(disk_node)

+        # LupioRNG Device
+        lupio_rng = self.lupio_rng
+        lupio_rng_node = lupio_rng.generateBasicPioDeviceNode(soc_state,
+ "lupio-rng", lupio_rng.pio_addr,lupio_rng.pio_size)
+        lupio_rng_node.appendCompatible(["lupio,rng"])
+        lupio_rng_node.append(
+                FdtPropertyWords("interrupts",
+                [self.lupio_rng.int_id]))
+        lupio_rng_node.append(
+                FdtPropertyWords("interrupt-parent",
+                state.phandle(self.pic)))
+        soc_node.append(lupio_rng_node)
+
         # LupioRTC Device
         lupio_rtc = self.lupio_rtc
         lupio_rtc_node = lupio_rtc.generateBasicPioDeviceNode(

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/53030
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I89c78c119a46cc7b056005d8abef16b1816ee4c4
Gerrit-Change-Number: 53030
Gerrit-PatchSet: 1
Gerrit-Owner: Melissa Jost <melissakj...@gmail.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to