diff --git a/emulation/betrusted.resc b/emulation/betrusted.resc index f3fb46c12..4d8d7afcf 100644 --- a/emulation/betrusted.resc +++ b/emulation/betrusted.resc @@ -18,11 +18,11 @@ i @peripherals/BQ24157.cs i @peripherals/BQ27421.cs i @peripherals/BtEvents.cs i @peripherals/ComConnector.cs -EnsureTypeIsLoaded "Antmicro.Renode.Peripherals.SPI.IComPeripheral" -EnsureTypeIsLoaded "Antmicro.Renode.Peripherals.SPI.IComController" +EnsureTypeIsLoaded "Antmicro.Renode.Peripherals.SPI.Betrusted.IComPeripheral" +EnsureTypeIsLoaded "Antmicro.Renode.Peripherals.SPI.Betrusted.IComController" i @peripherals/ComEc.cs i @peripherals/ComSoC.cs -i @peripherals/ec_power.cs +i @peripherals/EcPower.cs i @peripherals/EcWifi.cs i @peripherals/engine.cs i @peripherals/Jtag.cs @@ -46,7 +46,7 @@ i @peripherals/wfi.cs EnsureTypeIsLoaded "Antmicro.Renode.Peripherals.CPU.VexRiscv" i @peripherals/vexriscv-aes.cs -EnsureTypeIsLoaded "Antmicro.Renode.Peripherals.Timers.TickTimer" +EnsureTypeIsLoaded "Antmicro.Renode.Peripherals.Timers.Betrusted.TickTimer" i @peripherals/susres.cs # Create the COM SPI bus diff --git a/emulation/ec/betrusted-ec.repl b/emulation/ec/betrusted-ec.repl index a240cfa1f..e1918ef07 100644 --- a/emulation/ec/betrusted-ec.repl +++ b/emulation/ec/betrusted-ec.repl @@ -7,23 +7,23 @@ uart: UART.LiteX_UART @ { } -> cpu@1001 -timer0: Timers.LiteX_Timer_32 @ { +timer0: Timers.Betrusted.LiteX_Timer_32 @ { sysbus 0xe0001000 } frequency: 100000000 -> cpu@1000 -i2c: I2C.BetrustedEcI2C @ sysbus 0xE0004800 +i2c: I2C.Betrusted.BetrustedEcI2C @ sysbus 0xE0004800 -> cpu @ 1002 -ticktimer: Timers.TickTimer @ sysbus 0xe0005000 +ticktimer: Timers.Betrusted.TickTimer @ sysbus 0xe0005000 -> cpu @ 1003 -com: SPI.BetrustedEcCom @ sysbus 0xe0005800 +com: SPI.Betrusted.BetrustedEcCom @ sysbus 0xe0005800 memAddr: 0xD0000000 memSize: 0x1000 -wifi: SPI.EcWifi @ sysbus 0xe0006000 +wifi: SPI.Betrusted.EcWifi @ sysbus 0xe0006000 sram: Memory.MappedMemory @ { sysbus 0x10000000; @@ -31,7 +31,7 @@ sram: Memory.MappedMemory @ { } size: 0x00020000 -power: Miscellaneous.EcPower @ sysbus 0xE0002800 +power: Miscellaneous.Betrusted.EcPower @ sysbus 0xE0002800 rom: Memory.MappedMemory @ { sysbus 0x00000000; @@ -45,12 +45,12 @@ flash_mem: Memory.MappedMemory @ { } size: 0x00200000 -lm3509: Mocks.LM3509 @ i2c 0x36 -tusb320lai: Mocks.TUSB320LAI @ i2c 0x47 -bq27421: Sensors.BQ27421 @ i2c 0x55 -bq24157: Mocks.BQ24157 @ i2c 0x6a -lsm6ds3: Mocks.LSM6DS3 @ i2c 0x6b -wf200: Network.WF200 @ wifi +lm3509: Mocks.Betrusted.LM3509 @ i2c 0x36 +tusb320lai: Mocks.Betrusted.TUSB320LAI @ i2c 0x47 +bq27421: Sensors.Betrusted.BQ27421 @ i2c 0x55 +bq24157: Mocks.Betrusted.BQ24157 @ i2c 0x6a +lsm6ds3: Mocks.Betrusted.LSM6DS3 @ i2c 0x6b +wf200: Network.Betrusted.WF200 @ wifi sysbus: init: diff --git a/emulation/peripherals/ABRTCMC.cs b/emulation/peripherals/ABRTCMC.cs index db3256f79..6e92f2c47 100644 --- a/emulation/peripherals/ABRTCMC.cs +++ b/emulation/peripherals/ABRTCMC.cs @@ -7,13 +7,10 @@ using System; using Antmicro.Renode.Core.Structure.Registers; -using Antmicro.Renode.Exceptions; -using Antmicro.Renode.Logging; using Antmicro.Renode.Peripherals.I2C; using Antmicro.Renode.Peripherals.Sensor; -using Antmicro.Renode.Utilities; -namespace Antmicro.Renode.Peripherals.Sensors +namespace Antmicro.Renode.Peripherals.Timers.Betrusted { public class ABRTCMC : II2CPeripheral, IProvidesRegisterCollection, ISensor { diff --git a/emulation/peripherals/BQ24157.cs b/emulation/peripherals/BQ24157.cs index 1a2dd9d94..f6416efc7 100644 --- a/emulation/peripherals/BQ24157.cs +++ b/emulation/peripherals/BQ24157.cs @@ -9,7 +9,7 @@ using Antmicro.Renode.Logging; using Antmicro.Renode.Utilities; using Antmicro.Renode.Peripherals.I2C; -namespace Antmicro.Renode.Peripherals.Mocks +namespace Antmicro.Renode.Peripherals.Mocks.Betrusted { public class BQ24157 : II2CPeripheral { diff --git a/emulation/peripherals/BQ27421.cs b/emulation/peripherals/BQ27421.cs index 0af712cbf..756619128 100644 --- a/emulation/peripherals/BQ27421.cs +++ b/emulation/peripherals/BQ27421.cs @@ -6,18 +6,14 @@ // using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; using Antmicro.Renode.Core; using Antmicro.Renode.Core.Structure.Registers; using Antmicro.Renode.Logging; using Antmicro.Renode.Peripherals.I2C; using Antmicro.Renode.Peripherals.Sensor; using Antmicro.Renode.Utilities; -using Antmicro.Renode.Exceptions; -namespace Antmicro.Renode.Peripherals.Sensors +namespace Antmicro.Renode.Peripherals.Sensors.Betrusted { public class BQ27421 : II2CPeripheral, IProvidesRegisterCollection, ISensor, ITemperatureSensor { diff --git a/emulation/peripherals/BetrustedEcI2C.cs b/emulation/peripherals/BetrustedEcI2C.cs index 69db841f1..2862b3a37 100644 --- a/emulation/peripherals/BetrustedEcI2C.cs +++ b/emulation/peripherals/BetrustedEcI2C.cs @@ -17,7 +17,7 @@ using System.Threading; // This project is a reimplementation of the OpenCoresI2C module. -namespace Antmicro.Renode.Peripherals.I2C +namespace Antmicro.Renode.Peripherals.I2C.Betrusted { [AllowedTranslations(AllowedTranslation.ByteToDoubleWord)] public class BetrustedEcI2C : SimpleContainer, IDoubleWordPeripheral, IKnownSize diff --git a/emulation/peripherals/BetrustedI2S.cs b/emulation/peripherals/BetrustedI2S.cs index eef1ee20e..113ab7ef7 100644 --- a/emulation/peripherals/BetrustedI2S.cs +++ b/emulation/peripherals/BetrustedI2S.cs @@ -6,18 +6,15 @@ // using System; -using System.Collections.Generic; -using System.IO; using System.Linq; using Antmicro.Renode.Core; using Antmicro.Renode.Core.Structure.Registers; -using Antmicro.Renode.Exceptions; using Antmicro.Renode.Logging; using Antmicro.Renode.Peripherals.Bus; using Antmicro.Renode.Sound; using Antmicro.Renode.Utilities; -namespace Antmicro.Renode.Peripherals.Sound +namespace Antmicro.Renode.Peripherals.Sound.Betrusted { public class AudioRam : IBytePeripheral, IDoubleWordPeripheral, IWordPeripheral, IKnownSize { diff --git a/emulation/peripherals/BetrustedSocI2C.cs b/emulation/peripherals/BetrustedSocI2C.cs index 68447932f..a471d174e 100644 --- a/emulation/peripherals/BetrustedSocI2C.cs +++ b/emulation/peripherals/BetrustedSocI2C.cs @@ -12,11 +12,10 @@ using Antmicro.Renode.Core.Structure; using Antmicro.Renode.Core; using Antmicro.Renode.Logging; using Antmicro.Renode.Time; -using Antmicro.Renode.Utilities; // This project is a reimplementation of the OpenCoresI2C module. -namespace Antmicro.Renode.Peripherals.I2C +namespace Antmicro.Renode.Peripherals.I2C.Betrusted { [AllowedTranslations(AllowedTranslation.ByteToDoubleWord)] public class BetrustedSocI2C : SimpleContainer, IDoubleWordPeripheral, IKnownSize diff --git a/emulation/peripherals/BetrustedSpinor.cs b/emulation/peripherals/BetrustedSpinor.cs index 476bc9a0d..ec4a81f22 100644 --- a/emulation/peripherals/BetrustedSpinor.cs +++ b/emulation/peripherals/BetrustedSpinor.cs @@ -5,16 +5,16 @@ // Full license text is available in 'licenses/MIT.txt'. // -using System; using System.Collections.Generic; using Antmicro.Renode.Core; using Antmicro.Renode.Core.Structure; using Antmicro.Renode.Core.Structure.Registers; using Antmicro.Renode.Logging; using Antmicro.Renode.Peripherals.Bus; +using Antmicro.Renode.Peripherals.SPI; using Antmicro.Renode.Utilities; -namespace Antmicro.Renode.Peripherals.SPI +namespace Antmicro.Renode.Peripherals.SPI.Betrusted { [AllowedTranslations(AllowedTranslation.ByteToDoubleWord | AllowedTranslation.WordToDoubleWord)] public class BetrustedSpinor : NullRegistrationPointPeripheralContainer, IDoubleWordPeripheral, IKnownSize diff --git a/emulation/peripherals/BetrustedWatchdog.cs b/emulation/peripherals/BetrustedWatchdog.cs index f55d59509..1f852288b 100644 --- a/emulation/peripherals/BetrustedWatchdog.cs +++ b/emulation/peripherals/BetrustedWatchdog.cs @@ -13,7 +13,7 @@ using System.Threading; using System.Collections.Generic; using System; -namespace Antmicro.Renode.Peripherals.Timers +namespace Antmicro.Renode.Peripherals.Timers.Betrusted { public sealed class BetrustedWatchdog : BasicDoubleWordPeripheral, IKnownSize { diff --git a/emulation/peripherals/BtEvents.cs b/emulation/peripherals/BtEvents.cs index 3a35042b3..7c3c4de1e 100644 --- a/emulation/peripherals/BtEvents.cs +++ b/emulation/peripherals/BtEvents.cs @@ -5,13 +5,12 @@ // Full license text is available in 'licenses/MIT.txt'. using System; -using System.Linq; using Antmicro.Renode.Core; using Antmicro.Renode.Peripherals.Bus; using Antmicro.Renode.Core.Structure.Registers; using Antmicro.Renode.Logging; -namespace Antmicro.Renode.Peripherals.GPIOPort +namespace Antmicro.Renode.Peripherals.GPIOPort.Betrusted { public class BtEvents : BaseGPIOPort, IProvidesRegisterCollection, IDoubleWordPeripheral, IKnownSize { diff --git a/emulation/peripherals/ComConnector.cs b/emulation/peripherals/ComConnector.cs index fd054c9cc..6d3ba11ed 100644 --- a/emulation/peripherals/ComConnector.cs +++ b/emulation/peripherals/ComConnector.cs @@ -4,18 +4,14 @@ // This file is licensed under the MIT License. // Full license text is available in 'licenses/MIT.txt'. // -using System.Collections.Generic; using Antmicro.Renode.Core; using Antmicro.Renode.Core.Structure; using Antmicro.Renode.Exceptions; using Antmicro.Renode.Logging; using Antmicro.Renode.Time; using Antmicro.Renode.Utilities; -using Antmicro.Renode.Peripherals.Bus; -using Antmicro.Renode.Core.Structure.Registers; -using System.Collections.Concurrent; -namespace Antmicro.Renode.Peripherals.SPI +namespace Antmicro.Renode.Peripherals.SPI.Betrusted { public interface IComPeripheral : IPeripheral, IInterestingType { diff --git a/emulation/peripherals/ComEc.cs b/emulation/peripherals/ComEc.cs index 1f26c0cee..6a31f4fa2 100644 --- a/emulation/peripherals/ComEc.cs +++ b/emulation/peripherals/ComEc.cs @@ -4,18 +4,13 @@ // This file is licensed under the MIT License. // Full license text is available in 'licenses/MIT.txt'. // -using System.Collections.Generic; using Antmicro.Renode.Core; -using Antmicro.Renode.Core.Structure; -using Antmicro.Renode.Exceptions; using Antmicro.Renode.Logging; -using Antmicro.Renode.Time; -using Antmicro.Renode.Utilities; using Antmicro.Renode.Peripherals.Bus; using Antmicro.Renode.Core.Structure.Registers; using System.Collections.Concurrent; -namespace Antmicro.Renode.Peripherals.SPI +namespace Antmicro.Renode.Peripherals.SPI.Betrusted { public class BetrustedEcRam : IDoubleWordPeripheral, IKnownSize { diff --git a/emulation/peripherals/ComSoC.cs b/emulation/peripherals/ComSoC.cs index c05746536..32c811985 100644 --- a/emulation/peripherals/ComSoC.cs +++ b/emulation/peripherals/ComSoC.cs @@ -4,18 +4,12 @@ // This file is licensed under the MIT License. // Full license text is available in 'licenses/MIT.txt'. // -using System.Collections.Generic; using Antmicro.Renode.Core; using Antmicro.Renode.Core.Structure; -using Antmicro.Renode.Exceptions; -using Antmicro.Renode.Logging; -using Antmicro.Renode.Time; -using Antmicro.Renode.Utilities; using Antmicro.Renode.Peripherals.Bus; using Antmicro.Renode.Core.Structure.Registers; -using System.Collections.Concurrent; -namespace Antmicro.Renode.Peripherals.SPI +namespace Antmicro.Renode.Peripherals.SPI.Betrusted { public class BetrustedSocCom : NullRegistrationPointPeripheralContainer, IDoubleWordPeripheral, IProvidesRegisterCollection, IKnownSize, IGPIOReceiver diff --git a/emulation/peripherals/ec_power.cs b/emulation/peripherals/EcPower.cs similarity index 94% rename from emulation/peripherals/ec_power.cs rename to emulation/peripherals/EcPower.cs index c9a13da59..4ce512e50 100644 --- a/emulation/peripherals/ec_power.cs +++ b/emulation/peripherals/EcPower.cs @@ -5,14 +5,11 @@ // This file is licensed under the MIT License. // Full license text is available in 'licenses/MIT.txt'. // -using System; -using System.Collections.Generic; using Antmicro.Renode.Core; using Antmicro.Renode.Core.Structure.Registers; -using Antmicro.Renode.Logging; using Antmicro.Renode.Peripherals.Bus; -namespace Antmicro.Renode.Peripherals.Miscellaneous +namespace Antmicro.Renode.Peripherals.Miscellaneous.Betrusted { public class EcPower : IDoubleWordPeripheral, IProvidesRegisterCollection, IKnownSize { diff --git a/emulation/peripherals/EcWifi.cs b/emulation/peripherals/EcWifi.cs index a13169d11..61f691cd9 100644 --- a/emulation/peripherals/EcWifi.cs +++ b/emulation/peripherals/EcWifi.cs @@ -4,19 +4,14 @@ // This file is licensed under the MIT License. // Full license text is available in 'licenses/MIT.txt'. // -using System.Collections.Generic; using Antmicro.Renode.Core; using Antmicro.Renode.Core.Structure; -using Antmicro.Renode.Exceptions; using Antmicro.Renode.Logging; -using Antmicro.Renode.Time; -using Antmicro.Renode.Utilities; using Antmicro.Renode.Peripherals.Bus; using Antmicro.Renode.Core.Structure.Registers; -using System.Collections.Concurrent; // This SPI block is optimized for the WF200 chip. It always transfers 16 bits -namespace Antmicro.Renode.Peripherals.SPI +namespace Antmicro.Renode.Peripherals.SPI.Betrusted { public class EcWifi : NullRegistrationPointPeripheralContainer, IDoubleWordPeripheral, IProvidesRegisterCollection, IKnownSize { diff --git a/emulation/peripherals/Jtag.cs b/emulation/peripherals/Jtag.cs index 0d08e1900..366c6808e 100644 --- a/emulation/peripherals/Jtag.cs +++ b/emulation/peripherals/Jtag.cs @@ -5,19 +5,12 @@ // This file is licensed under the MIT License. // Full license text is available in 'licenses/MIT.txt'. // -using System; -using System.Threading; -using System.Text; -using System.Linq; -using System.Globalization; -using System.Numerics; using Antmicro.Renode.Core; using Antmicro.Renode.Core.Structure.Registers; using Antmicro.Renode.Logging; using Antmicro.Renode.Peripherals.Bus; -using Antmicro.Renode.Utilities.Binding; -namespace Antmicro.Renode.Peripherals.Miscellaneous +namespace Antmicro.Renode.Peripherals.Miscellaneous.Betrusted { public class BetrustedJtag : IDoubleWordPeripheral, IProvidesRegisterCollection, IKnownSize diff --git a/emulation/peripherals/LM3509.cs b/emulation/peripherals/LM3509.cs index 522e3148c..6eb00d71a 100644 --- a/emulation/peripherals/LM3509.cs +++ b/emulation/peripherals/LM3509.cs @@ -9,7 +9,7 @@ using Antmicro.Renode.Logging; using Antmicro.Renode.Utilities; using Antmicro.Renode.Peripherals.I2C; -namespace Antmicro.Renode.Peripherals.Mocks +namespace Antmicro.Renode.Peripherals.Mocks.Betrusted { public class LM3509 : II2CPeripheral { diff --git a/emulation/peripherals/LSM6DS3.cs b/emulation/peripherals/LSM6DS3.cs index d5bd6178a..730ddc11c 100644 --- a/emulation/peripherals/LSM6DS3.cs +++ b/emulation/peripherals/LSM6DS3.cs @@ -9,7 +9,7 @@ using Antmicro.Renode.Logging; using Antmicro.Renode.Utilities; using Antmicro.Renode.Peripherals.I2C; -namespace Antmicro.Renode.Peripherals.Mocks +namespace Antmicro.Renode.Peripherals.Mocks.Betrusted { public class LSM6DS3 : II2CPeripheral { diff --git a/emulation/peripherals/LiteX_Timer_32.cs b/emulation/peripherals/LiteX_Timer_32.cs index d755088c7..59fcb9b73 100644 --- a/emulation/peripherals/LiteX_Timer_32.cs +++ b/emulation/peripherals/LiteX_Timer_32.cs @@ -6,11 +6,10 @@ // using Antmicro.Renode.Core; using Antmicro.Renode.Core.Structure.Registers; -using Antmicro.Renode.Utilities; using Antmicro.Renode.Logging; using Antmicro.Renode.Peripherals.Bus; -namespace Antmicro.Renode.Peripherals.Timers +namespace Antmicro.Renode.Peripherals.Timers.Betrusted { // this is a model of LiteX timer in the Betrusted configuration: // * width: 32 bits diff --git a/emulation/peripherals/MXIC_MX66UM1G45G.cs b/emulation/peripherals/MXIC_MX66UM1G45G.cs index 6ded1d5dc..43d08bed9 100644 --- a/emulation/peripherals/MXIC_MX66UM1G45G.cs +++ b/emulation/peripherals/MXIC_MX66UM1G45G.cs @@ -13,7 +13,7 @@ using Antmicro.Renode.Peripherals.Memory; using Antmicro.Renode.Peripherals.SPI.NORFlash; using Antmicro.Renode.Utilities; -namespace Antmicro.Renode.Peripherals.SPI +namespace Antmicro.Renode.Peripherals.SPI.Betrusted { public class MXIC_MX66UM1G45G : ISPIPeripheral { diff --git a/emulation/peripherals/TLV320AIC3100.cs b/emulation/peripherals/TLV320AIC3100.cs index 5fcc1ca9b..61178c566 100644 --- a/emulation/peripherals/TLV320AIC3100.cs +++ b/emulation/peripherals/TLV320AIC3100.cs @@ -5,19 +5,13 @@ // Full license text is available in 'licenses/MIT.txt'. // -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; using Antmicro.Renode.Core; using Antmicro.Renode.Core.Structure.Registers; using Antmicro.Renode.Logging; using Antmicro.Renode.Peripherals.I2C; -using Antmicro.Renode.Peripherals.Sensor; using Antmicro.Renode.Utilities; -using Antmicro.Renode.Exceptions; -namespace Antmicro.Renode.Peripherals.Sensors +namespace Antmicro.Renode.Peripherals.Sensors.Betrusted { public class TLV320AIC3100 : II2CPeripheral, IProvidesRegisterCollection { diff --git a/emulation/peripherals/TUSB320LAI.cs b/emulation/peripherals/TUSB320LAI.cs index ca4a3936a..3e2d4b79c 100644 --- a/emulation/peripherals/TUSB320LAI.cs +++ b/emulation/peripherals/TUSB320LAI.cs @@ -9,7 +9,7 @@ using Antmicro.Renode.Logging; using Antmicro.Renode.Utilities; using Antmicro.Renode.Peripherals.I2C; -namespace Antmicro.Renode.Peripherals.Mocks +namespace Antmicro.Renode.Peripherals.Mocks.Betrusted { public class TUSB320LAI : II2CPeripheral { diff --git a/emulation/peripherals/WF200.cs b/emulation/peripherals/WF200.cs index 376be7383..92cd5534d 100644 --- a/emulation/peripherals/WF200.cs +++ b/emulation/peripherals/WF200.cs @@ -16,7 +16,7 @@ using Antmicro.Renode.Logging; using Antmicro.Renode.Network; using Antmicro.Renode.Utilities; -namespace Antmicro.Renode.Peripherals.Network +namespace Antmicro.Renode.Peripherals.Network.Betrusted { public class WF200 : ISPIPeripheral, IMACInterface, IProvidesRegisterCollection { diff --git a/emulation/peripherals/engine.cs b/emulation/peripherals/engine.cs index 148df57da..e5f855cd4 100644 --- a/emulation/peripherals/engine.cs +++ b/emulation/peripherals/engine.cs @@ -9,14 +9,13 @@ using System; using System.Threading; using System.Text; using System.Linq; -using System.Globalization; using System.Numerics; using Antmicro.Renode.Core; using Antmicro.Renode.Core.Structure.Registers; using Antmicro.Renode.Logging; using Antmicro.Renode.Peripherals.Bus; -namespace Antmicro.Renode.Peripherals.Miscellaneous +namespace Antmicro.Renode.Peripherals.Miscellaneous.Betrusted { public class EngineRam : IDoubleWordPeripheral, IKnownSize { diff --git a/emulation/peripherals/keyboard.cs b/emulation/peripherals/keyboard.cs index 89db99bed..b26b41292 100644 --- a/emulation/peripherals/keyboard.cs +++ b/emulation/peripherals/keyboard.cs @@ -12,7 +12,7 @@ using Antmicro.Renode.Core.Structure.Registers; using Antmicro.Renode.Logging; using Antmicro.Renode.Peripherals.Bus; -namespace Antmicro.Renode.Peripherals.Input +namespace Antmicro.Renode.Peripherals.Input.Betrusted { class KeyMap { diff --git a/emulation/peripherals/keyrom.cs b/emulation/peripherals/keyrom.cs index 312ef5b3c..30bd41e4c 100644 --- a/emulation/peripherals/keyrom.cs +++ b/emulation/peripherals/keyrom.cs @@ -6,15 +6,11 @@ // Full license text is available in 'licenses/MIT.txt'. // using System; -using System.Collections.Generic; -using System.Security.Cryptography; using Antmicro.Renode.Core; using Antmicro.Renode.Core.Structure.Registers; -using Antmicro.Renode.Logging; using Antmicro.Renode.Peripherals.Bus; -using Antmicro.Renode.Peripherals.CPU; -namespace Antmicro.Renode.Peripherals.Miscellaneous +namespace Antmicro.Renode.Peripherals.Miscellaneous.Betrusted { public class Keyrom : IDoubleWordPeripheral, IProvidesRegisterCollection, IKnownSize { diff --git a/emulation/peripherals/memlcd.cs b/emulation/peripherals/memlcd.cs index 2a70459ff..c0ca823fb 100644 --- a/emulation/peripherals/memlcd.cs +++ b/emulation/peripherals/memlcd.cs @@ -12,7 +12,7 @@ using Antmicro.Renode.Core; using Antmicro.Renode.Core.Structure.Registers; using Antmicro.Renode.Peripherals.Bus; -namespace Antmicro.Renode.Peripherals.Video +namespace Antmicro.Renode.Peripherals.Video.Betrusted { public class VideoRam : IBytePeripheral, IDoubleWordPeripheral, IWordPeripheral, IKnownSize diff --git a/emulation/peripherals/sha512.cs b/emulation/peripherals/sha512.cs index 98a0b11c6..eda6308b6 100644 --- a/emulation/peripherals/sha512.cs +++ b/emulation/peripherals/sha512.cs @@ -9,7 +9,7 @@ using System; using System.Collections.Generic; using System.Linq; -namespace Antmicro.Renode.Peripherals.Miscellaneous +namespace Antmicro.Renode.Peripherals.Miscellaneous.Betrusted { using System; using System.Security.Cryptography; diff --git a/emulation/peripherals/spinor_soft_int.cs b/emulation/peripherals/spinor_soft_int.cs index a11d9bf9e..1190a9f73 100644 --- a/emulation/peripherals/spinor_soft_int.cs +++ b/emulation/peripherals/spinor_soft_int.cs @@ -5,18 +5,11 @@ // This file is licensed under the MIT License. // Full license text is available in 'licenses/MIT.txt'. // -using System; -using System.Threading; -using System.Text; -using System.Linq; -using System.Globalization; -using System.Numerics; using Antmicro.Renode.Core; using Antmicro.Renode.Core.Structure.Registers; -using Antmicro.Renode.Logging; using Antmicro.Renode.Peripherals.Bus; -namespace Antmicro.Renode.Peripherals.Miscellaneous +namespace Antmicro.Renode.Peripherals.Miscellaneous.Betrusted { public class SpinorSoftInt : IDoubleWordPeripheral, IProvidesRegisterCollection, IKnownSize diff --git a/emulation/peripherals/susres.cs b/emulation/peripherals/susres.cs index 5f5de225d..dcdf2a06e 100644 --- a/emulation/peripherals/susres.cs +++ b/emulation/peripherals/susres.cs @@ -4,15 +4,12 @@ // This file is licensed under the MIT License. // Full license text is available in 'licenses/MIT.txt'. // -using System; using Antmicro.Renode.Core; using Antmicro.Renode.Core.Structure.Registers; using Antmicro.Renode.Logging; -using Antmicro.Renode.Time; using Antmicro.Renode.Peripherals.Bus; -using System.Threading; -namespace Antmicro.Renode.Peripherals.Timers +namespace Antmicro.Renode.Peripherals.Timers.Betrusted { // this is a model of LiteX timer in the Betrusted configuration: // * width: 32 bits diff --git a/emulation/peripherals/ticktimer.cs b/emulation/peripherals/ticktimer.cs index 4ed6b4098..854ec55af 100644 --- a/emulation/peripherals/ticktimer.cs +++ b/emulation/peripherals/ticktimer.cs @@ -4,16 +4,14 @@ // This file is licensed under the MIT License. // Full license text is available in 'licenses/MIT.txt'. // -using System; using Antmicro.Renode.Core; using Antmicro.Renode.Core.Structure.Registers; -using Antmicro.Renode.Utilities; using Antmicro.Renode.Logging; using Antmicro.Renode.Time; using Antmicro.Renode.Peripherals.Bus; using System.Threading; -namespace Antmicro.Renode.Peripherals.Timers +namespace Antmicro.Renode.Peripherals.Timers.Betrusted { // this is a model of LiteX timer in the Betrusted configuration: // * width: 32 bits diff --git a/emulation/peripherals/trng_kernel.cs b/emulation/peripherals/trng_kernel.cs index 348a467b8..7ae8b0fd3 100644 --- a/emulation/peripherals/trng_kernel.cs +++ b/emulation/peripherals/trng_kernel.cs @@ -6,9 +6,8 @@ // using Antmicro.Renode.Core; using Antmicro.Renode.Core.Structure.Registers; -using Antmicro.Renode.Logging; -namespace Antmicro.Renode.Peripherals.Miscellaneous +namespace Antmicro.Renode.Peripherals.Miscellaneous.Betrusted { public class BetrustedRNGKernel : BasicDoubleWordPeripheral, IKnownSize { diff --git a/emulation/peripherals/trng_server.cs b/emulation/peripherals/trng_server.cs index decda0eb1..bcbd7e4d6 100644 --- a/emulation/peripherals/trng_server.cs +++ b/emulation/peripherals/trng_server.cs @@ -6,9 +6,8 @@ // using Antmicro.Renode.Core; using Antmicro.Renode.Core.Structure.Registers; -using Antmicro.Renode.Logging; -namespace Antmicro.Renode.Peripherals.Miscellaneous +namespace Antmicro.Renode.Peripherals.Miscellaneous.Betrusted { public class BetrustedRNGServer : BasicDoubleWordPeripheral, IKnownSize { diff --git a/emulation/peripherals/vexriscv-aes.cs b/emulation/peripherals/vexriscv-aes.cs index 13e3bf122..ca8da9a27 100644 --- a/emulation/peripherals/vexriscv-aes.cs +++ b/emulation/peripherals/vexriscv-aes.cs @@ -5,12 +5,10 @@ // Full license text is available in 'licenses/MIT.txt'. // using System; -using ELFSharp.ELF; using Antmicro.Renode.Utilities; -using Antmicro.Renode.Logging; using Antmicro.Renode.Peripherals.Timers; -namespace Antmicro.Renode.Peripherals.CPU +namespace Antmicro.Renode.Peripherals.CPU.Betrusted { public class AesVexRiscv : VexRiscv { diff --git a/emulation/peripherals/wfi.cs b/emulation/peripherals/wfi.cs index fc49c92e7..ff222c861 100644 --- a/emulation/peripherals/wfi.cs +++ b/emulation/peripherals/wfi.cs @@ -6,18 +6,12 @@ // Full license text is available in 'licenses/MIT.txt'. // using System; -using System.Threading; -using System.Text; -using System.Linq; -using System.Globalization; -using System.Numerics; using Antmicro.Renode.Core; using Antmicro.Renode.Core.Structure.Registers; -using Antmicro.Renode.Logging; using Antmicro.Renode.Peripherals.Bus; using Antmicro.Renode.Utilities.Binding; -namespace Antmicro.Renode.Peripherals.Miscellaneous +namespace Antmicro.Renode.Peripherals.Miscellaneous.Betrusted { public class BetrustedWfi : IDoubleWordPeripheral, IProvidesRegisterCollection, IKnownSize diff --git a/emulation/soc/betrusted-soc.repl b/emulation/soc/betrusted-soc.repl index 8f2e2bc49..c6569e33b 100644 --- a/emulation/soc/betrusted-soc.repl +++ b/emulation/soc/betrusted-soc.repl @@ -1,13 +1,13 @@ // Renode Platform file generated by svd2repl // This file is automatically generated -cpu: CPU.AesVexRiscv @ sysbus +cpu: CPU.Betrusted.AesVexRiscv @ sysbus cpuType: "rv32imac" privilegeArchitecture: PrivilegeArchitecture.Priv1_10 PerformanceInMips: 120 // Platform Peripherals // Unrecognized peripheral: reboot @ 0xf0000000 -timer0: Timers.LiteX_Timer_32 @ sysbus 0xf0001000 +timer0: Timers.Betrusted.LiteX_Timer_32 @ sysbus 0xf0001000 frequency: 100000000 IRQ -> cpu @ 1000 @@ -28,76 +28,76 @@ app_uart: UART.LiteX_UART @ sysbus 0xf0009000 // Unrecognized peripheral: sram_ext @ 0xf000b000 -memlcd: Video.BetrustedLCD @ sysbus 0xf000c000 +memlcd: Video.Betrusted.BetrustedLCD @ sysbus 0xf000c000 memAddr: 0xb0000000 memSize: 0x5c20 -com: SPI.BetrustedSocCom @ sysbus 0xf000d000 +com: SPI.Betrusted.BetrustedSocCom @ sysbus 0xf000d000 EC_INTERRUPT -> btevents @ 0 IRQ -> cpu @ 1005 -i2c: I2C.BetrustedSocI2C @ sysbus 0xf000e000 +i2c: I2C.Betrusted.BetrustedSocI2C @ sysbus 0xf000e000 IRQ -> cpu @ 1006 -btevents: GPIOPort.BtEvents @ sysbus 0xf000f000 +btevents: GPIOPort.Betrusted.BtEvents @ sysbus 0xf000f000 IRQ -> cpu @ 1007 // Unrecognized peripheral: messible @ 0xf0010000 // Unrecognized peripheral: messible2 @ 0xf0011000 -ticktimer: Timers.TickTimer @ sysbus 0xf0012000 +ticktimer: Timers.Betrusted.TickTimer @ sysbus 0xf0012000 IRQ -> cpu @ 1008 -susres: Timers.SusRes @ sysbus 0xf0013000 +susres: Timers.Betrusted.SusRes @ sysbus 0xf0013000 IRQ -> cpu @ 1009 // Unrecognized peripheral: power @ 0xf0014000 -spinor_soft_int: Miscellaneous.SpinorSoftInt @ sysbus 0xf0015000 +spinor_soft_int: Miscellaneous.Betrusted.SpinorSoftInt @ sysbus 0xf0015000 IRQ -> cpu @ 1011 -spinor: SPI.BetrustedSpinor @ sysbus 0xf0016000 +spinor: SPI.Betrusted.BetrustedSpinor @ sysbus 0xf0016000 IRQ -> cpu @ 1012 -keyboard: Input.BetrustedKbd @ sysbus 0xf0017000 +keyboard: Input.Betrusted.BetrustedKbd @ sysbus 0xf0017000 IRQ -> cpu @ 1013 // Unrecognized peripheral: keyinject @ 0xf0018000 // Unrecognized peripheral: seed @ 0xf0019000 -keyrom: Miscellaneous.Keyrom @ sysbus 0xf001a000 +keyrom: Miscellaneous.Betrusted.Keyrom @ sysbus 0xf001a000 // Unrecognized peripheral: audio @ 0xf001b000 -trng_kernel: Miscellaneous.BetrustedRNGKernel @ sysbus 0xf001c000 +trng_kernel: Miscellaneous.Betrusted.BetrustedRNGKernel @ sysbus 0xf001c000 IRQ -> cpu @ 1015 -trng_server: Miscellaneous.BetrustedRNGServer @ sysbus 0xf001d000 +trng_server: Miscellaneous.Betrusted.BetrustedRNGServer @ sysbus 0xf001d000 IRQ -> cpu @ 1016 // Unrecognized peripheral: trng @ 0xf001e000 -sha512: Miscellaneous.Sha512 @ sysbus 0xf001f000 +sha512: Miscellaneous.Betrusted.Sha512 @ sysbus 0xf001f000 memAddr: 0xe0002000 memSize: 0x4 IRQ -> cpu @ 1017 -engine: Miscellaneous.Engine @ sysbus 0xf0020000 +engine: Miscellaneous.Betrusted.Engine @ sysbus 0xf0020000 memAddr: 0xe0020000 memSize: 0x20000 IRQ -> cpu @ 1018 -jtag: Miscellaneous.BetrustedJtag @ sysbus 0xf0021000 +jtag: Miscellaneous.Betrusted.BetrustedJtag @ sysbus 0xf0021000 -wdt: Timers.BetrustedWatchdog @ sysbus 0xf0022000 +wdt: Timers.Betrusted.BetrustedWatchdog @ sysbus 0xf0022000 // Unrecognized peripheral: usbdev @ 0xf0023000 // Unrecognized peripheral: d11ctime @ 0xf0024000 -wfi: Miscellaneous.BetrustedWfi @ sysbus 0xf0025000 +wfi: Miscellaneous.Betrusted.BetrustedWfi @ sysbus 0xf0025000 // Unrecognized peripheral: identifier_mem @ 0xf0026000 @@ -123,11 +123,11 @@ usbdev: Memory.MappedMemory @ sysbus 0xe0040000 -abracom_rtc: Sensors.ABRTCMC @ i2c 0x68 +abracom_rtc: Timers.Betrusted.ABRTCMC @ i2c 0x68 -audio_codec: Sensors.TLV320AIC3100 @ i2c 0x18 +audio_codec: Sensors.Betrusted.TLV320AIC3100 @ i2c 0x18 -flash: SPI.MXIC_MX66UM1G45G @ spinor +flash: SPI.Betrusted.MXIC_MX66UM1G45G @ spinor underlyingMemory: spiflash sysbus: diff --git a/svd2repl/src/generate.rs b/svd2repl/src/generate.rs index 9a661ba15..941af64f7 100644 --- a/svd2repl/src/generate.rs +++ b/svd2repl/src/generate.rs @@ -489,7 +489,7 @@ fn parse_vendor_extensions( fn print_header(out: &mut U) -> std::io::Result<()> { let s = r####"// Renode Platform file generated by svd2repl // This file is automatically generated -cpu: CPU.AesVexRiscv @ sysbus +cpu: CPU.Betrusted.AesVexRiscv @ sysbus cpuType: "rv32imac" privilegeArchitecture: PrivilegeArchitecture.Priv1_10 PerformanceInMips: 120 @@ -499,11 +499,11 @@ cpu: CPU.AesVexRiscv @ sysbus fn print_footer(out: &mut U) -> std::io::Result<()> { let s = r####" -abracom_rtc: Sensors.ABRTCMC @ i2c 0x68 +abracom_rtc: Timers.Betrusted.ABRTCMC @ i2c 0x68 -audio_codec: Sensors.TLV320AIC3100 @ i2c 0x18 +audio_codec: Sensors.Betrusted.TLV320AIC3100 @ i2c 0x18 -flash: SPI.MXIC_MX66UM1G45G @ spinor +flash: SPI.Betrusted.MXIC_MX66UM1G45G @ spinor underlyingMemory: spiflash sysbus: @@ -653,25 +653,25 @@ pub fn generate(src: T, dest: &mut U) -> Result<(), ParseErro let mut cs_peripherals = HashMap::new(); cs_peripherals.insert("app_uart", "UART.LiteX_UART"); cs_peripherals.insert("console", "UART.LiteX_UART"); - cs_peripherals.insert("btevents", "GPIOPort.BtEvents"); - cs_peripherals.insert("engine", "Miscellaneous.Engine"); - cs_peripherals.insert("com", "SPI.BetrustedSocCom"); - cs_peripherals.insert("i2c", "I2C.BetrustedSocI2C"); - cs_peripherals.insert("jtag", "Miscellaneous.BetrustedJtag"); - cs_peripherals.insert("keyboard", "Input.BetrustedKbd"); - cs_peripherals.insert("keyrom", "Miscellaneous.Keyrom"); - cs_peripherals.insert("memlcd", "Video.BetrustedLCD"); - cs_peripherals.insert("sha512", "Miscellaneous.Sha512"); - cs_peripherals.insert("spinor_soft_int", "Miscellaneous.SpinorSoftInt"); - cs_peripherals.insert("spinor", "SPI.BetrustedSpinor"); - cs_peripherals.insert("susres", "Timers.SusRes"); - cs_peripherals.insert("timer0", "Timers.LiteX_Timer_32"); - cs_peripherals.insert("trng_kernel", "Miscellaneous.BetrustedRNGKernel"); - cs_peripherals.insert("trng_server", "Miscellaneous.BetrustedRNGServer"); - cs_peripherals.insert("ticktimer", "Timers.TickTimer"); + cs_peripherals.insert("btevents", "GPIOPort.Betrusted.BtEvents"); + cs_peripherals.insert("engine", "Miscellaneous.Betrusted.Engine"); + cs_peripherals.insert("com", "SPI.Betrusted.BetrustedSocCom"); + cs_peripherals.insert("i2c", "I2C.Betrusted.BetrustedSocI2C"); + cs_peripherals.insert("jtag", "Miscellaneous.Betrusted.BetrustedJtag"); + cs_peripherals.insert("keyboard", "Input.Betrusted.BetrustedKbd"); + cs_peripherals.insert("keyrom", "Miscellaneous.Betrusted.Keyrom"); + cs_peripherals.insert("memlcd", "Video.Betrusted.BetrustedLCD"); + cs_peripherals.insert("sha512", "Miscellaneous.Betrusted.Sha512"); + cs_peripherals.insert("spinor_soft_int", "Miscellaneous.Betrusted.SpinorSoftInt"); + cs_peripherals.insert("spinor", "SPI.Betrusted.BetrustedSpinor"); + cs_peripherals.insert("susres", "Timers.Betrusted.SusRes"); + cs_peripherals.insert("timer0", "Timers.Betrusted.LiteX_Timer_32"); + cs_peripherals.insert("trng_kernel", "Miscellaneous.Betrusted.BetrustedRNGKernel"); + cs_peripherals.insert("trng_server", "Miscellaneous.Betrusted.BetrustedRNGServer"); + cs_peripherals.insert("ticktimer", "Timers.Betrusted.TickTimer"); cs_peripherals.insert("uart", "UART.LiteX_UART"); - cs_peripherals.insert("wfi", "Miscellaneous.BetrustedWfi"); - cs_peripherals.insert("wdt", "Timers.BetrustedWatchdog"); + cs_peripherals.insert("wfi", "Miscellaneous.Betrusted.BetrustedWfi"); + cs_peripherals.insert("wdt", "Timers.Betrusted.BetrustedWatchdog"); print_header(dest).or(Err(ParseError::WriteError))?; print_peripherals(