To protect your data, the CISO officer has suggested users to enable GitLab 2FA as soon as possible.

AbstractReaderSpec.scala 1.22 KB
Newer Older
Kunshan Wang's avatar
Kunshan Wang committed
1
2
3
4
5
package uvm.ir.textinput

import org.scalatest._
import uvm._

Kunshan Wang's avatar
Kunshan Wang committed
6
7
trait AbstractReaderSpec extends FlatSpec with Matchers {
//  with TestingBundlesValidators {
Kunshan Wang's avatar
Kunshan Wang committed
8
9
10
11
  
  val EMPTY_BUNDLE = new Bundle()
  
  def parseFile(fileName: String, globalBundle: Bundle): Bundle
Kunshan Wang's avatar
Kunshan Wang committed
12

Kunshan Wang's avatar
Kunshan Wang committed
13
  def theSubject: String
Kunshan Wang's avatar
Kunshan Wang committed
14

Kunshan Wang's avatar
Kunshan Wang committed
15
16
17
  behavior of theSubject

  it should "read simple type definitions" in {
Kunshan Wang's avatar
Kunshan Wang committed
18
    val b = parseFile("tests/uvm-parsing-test/types.uir", EMPTY_BUNDLE)
Kunshan Wang's avatar
Kunshan Wang committed
19
    //validateTypes(b)
Kunshan Wang's avatar
Kunshan Wang committed
20
21
  }
  it should "read simple constant definitions" in {
Kunshan Wang's avatar
Kunshan Wang committed
22
    val b = parseFile("tests/uvm-parsing-test/constants.uir", EMPTY_BUNDLE)
Kunshan Wang's avatar
Kunshan Wang committed
23
    //validateConstants(b)
Kunshan Wang's avatar
Kunshan Wang committed
24
25
  }
  it should "read simple function definitions" in {
Kunshan Wang's avatar
Kunshan Wang committed
26
    val b = parseFile("tests/uvm-parsing-test/functions.uir", EMPTY_BUNDLE)
Kunshan Wang's avatar
Kunshan Wang committed
27
    //validateFunctions(b)
Kunshan Wang's avatar
Kunshan Wang committed
28
29
  }
  it should "read simple instruction definitions" in {
Kunshan Wang's avatar
Kunshan Wang committed
30
    val b = parseFile("tests/uvm-parsing-test/instructions.uir", EMPTY_BUNDLE)
Kunshan Wang's avatar
Kunshan Wang committed
31
    //validateInstructions(b)
Kunshan Wang's avatar
Kunshan Wang committed
32
  }
Kunshan Wang's avatar
Kunshan Wang committed
33
  it should "handle loading of multiple bundles" in {
Kunshan Wang's avatar
Kunshan Wang committed
34
35
36
    //val gb = parseFile("tests/uvm-parsing-test/redef-base.uir", EMPTY_BUNDLE)
    //val b = parseFile("tests/uvm-parsing-test/redef-overlay.uir", gb)
    //validateRedef(gb, b)
Kunshan Wang's avatar
Kunshan Wang committed
37
    
Kunshan Wang's avatar
Kunshan Wang committed
38
39
    //gb.merge(b)
    //validateRedefAfterMerge(gb, b)
Kunshan Wang's avatar
Kunshan Wang committed
40
  }
Kunshan Wang's avatar
Kunshan Wang committed
41
}