Skip to content
This repository has been archived by the owner on Jun 16, 2024. It is now read-only.

Commit

Permalink
get rid of BaseIn/BaseOut.
Browse files Browse the repository at this point in the history
  • Loading branch information
kivikakk committed May 21, 2024
1 parent 1fcb792 commit c573661
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 20 deletions.
5 changes: 4 additions & 1 deletion src/main/scala/ee/hrzn/chryse/platform/resource/Base.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ abstract class Base[HW <: Data](gen: => HW) {
final private[chryse] var pinId: Option[Pin] = None
final private[chryse] var name: Option[String] = None

// Should return Chisel datatype.
// Should return Chisel datatype with Input/Output attached.
private[chryse] def makeIo(): HW = gen

final private[chryse] var ioInst: Option[InstSides[HW]] = None
Expand Down Expand Up @@ -52,4 +52,7 @@ abstract class Base[HW <: Data](gen: => HW) {

case class InstSides[HW](user: HW, top: HW)

// Note that the DataView doesn't really need or care about the generated data's
// direction or lack thereof, so this is sufficient for all Base[Bool]
// subclasses.
object BaseBool extends Base[Bool](Bool()) {}
7 changes: 0 additions & 7 deletions src/main/scala/ee/hrzn/chryse/platform/resource/BaseIn.scala

This file was deleted.

7 changes: 0 additions & 7 deletions src/main/scala/ee/hrzn/chryse/platform/resource/BaseOut.scala

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package ee.hrzn.chryse.platform.resource

import chisel3._

class Button extends BaseIn[Bool](Bool()) {
class Button extends Base[Bool](Input(Bool())) {
private var invert = false // TODO: possibly belongs in a higher class

def inverted: this.type = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package ee.hrzn.chryse.platform.resource

import chisel3._

case class ClockSource(hz: Int) extends BaseIn[Clock](Clock()) {}
case class ClockSource(hz: Int) extends Base[Clock](Input(Clock())) {}

object ClockSource {
def apply(hz: Int) = new ClockSource(hz)
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/ee/hrzn/chryse/platform/resource/LED.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package ee.hrzn.chryse.platform.resource

import chisel3._

class LED extends BaseOut[Bool](Bool()) {
class LED extends Base[Bool](Output(Bool())) {
private var invert = false // TODO: possibly belongs in a higher class

def inverted: this.type = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package ee.hrzn.chryse.platform.resource

import chisel3._

class UARTRX extends BaseIn[Bool](Bool()) {}
class UARTRX extends Base[Bool](Input(Bool())) {}

object UARTRX {
def apply() = new UARTRX
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package ee.hrzn.chryse.platform.resource

import chisel3._

class UARTTX extends BaseOut[Bool](Bool()) {}
class UARTTX extends Base[Bool](Output(Bool())) {}

object UARTTX {
def apply() = new UARTTX
Expand Down

0 comments on commit c573661

Please sign in to comment.