From 3b99090879a0da8d8e7373b2bda8ca492628d43d Mon Sep 17 00:00:00 2001 From: Dolu1990 Date: Tue, 16 Feb 2021 14:15:20 +0100 Subject: [PATCH] VexRiscvConfig.get added --- src/main/scala/vexriscv/VexRiscv.scala | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/scala/vexriscv/VexRiscv.scala b/src/main/scala/vexriscv/VexRiscv.scala index 5f7865c..5730898 100644 --- a/src/main/scala/vexriscv/VexRiscv.scala +++ b/src/main/scala/vexriscv/VexRiscv.scala @@ -29,6 +29,11 @@ case class VexRiscvConfig(){ case None => None } } + def get[T](clazz: Class[T]): T = { + plugins.find(_.getClass == clazz) match { + case Some(x) => x.asInstanceOf[T] + } + } //Default Stageables object IS_RVC extends Stageable(Bool)