From 4c3cad97d3db3e708e8065586612ebd624f9cf32 Mon Sep 17 00:00:00 2001 From: Dolu1990 Date: Fri, 4 Sep 2020 10:36:02 +0200 Subject: [PATCH] fix CfuPlugin generation --- .../scala/vexriscv/demo/GenSmallAndProductiveCfu.scala | 8 +++++++- src/main/scala/vexriscv/plugin/CfuPlugin.scala | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/scala/vexriscv/demo/GenSmallAndProductiveCfu.scala b/src/main/scala/vexriscv/demo/GenSmallAndProductiveCfu.scala index 960242f..1810787 100644 --- a/src/main/scala/vexriscv/demo/GenSmallAndProductiveCfu.scala +++ b/src/main/scala/vexriscv/demo/GenSmallAndProductiveCfu.scala @@ -53,7 +53,13 @@ object GenSmallAndProductiveCfu extends App{ new CfuPlugin( stageCount = 1, allowZeroLatency = true, -// encoding = M"000000-------------------0001011", + encodings = List( + CfuPluginEncoding ( + instruction = M"-------------------------0001011", + functionId = List(14 downto 12), + input2Kind = CfuPlugin.Input2Kind.RS + ) + ), busParameter = CfuBusParameter( CFU_VERSION = 0, CFU_INTERFACE_ID_W = 0, diff --git a/src/main/scala/vexriscv/plugin/CfuPlugin.scala b/src/main/scala/vexriscv/plugin/CfuPlugin.scala index de0ae91..a805bff 100644 --- a/src/main/scala/vexriscv/plugin/CfuPlugin.scala +++ b/src/main/scala/vexriscv/plugin/CfuPlugin.scala @@ -97,7 +97,7 @@ class CfuPlugin( val stageCount : Int, assert(p.CFU_INPUTS <= 2) assert(p.CFU_OUTPUTS == 1) - assert(p.CFU_FUNCTION_ID_W == 3) +// assert(p.CFU_FUNCTION_ID_W == 3) var bus : CfuBus = null var joinException : Flow[ExceptionCause] = null @@ -128,7 +128,7 @@ class CfuPlugin( val stageCount : Int, BYPASSABLE_EXECUTE_STAGE -> Bool(stageCount == 0), BYPASSABLE_MEMORY_STAGE -> Bool(stageCount <= 1), RS1_USE -> True, - CFU_ENCODING -> id, + CFU_ENCODING -> U(id), CFU_INPUT_2_KIND -> encoding.input2Kind() )