Kim Smith
Kim Smith

Reputation: 21

How to express specified index range of a Vec?

For example ,I want to express Vec(0),Vec(1),Vec(2),Vec(3),Vec(4) together.Can I express it Vec(0->4) ?If it's error,what should I do ? And I also want to know which is the fullest document of the Chisel?I have many problem,but I can't find the answer in my documents.I have Digital Design with Chisel and chisel_cheatsheet.

Upvotes: 2

Views: 471

Answers (2)

Jack Koenig
Jack Koenig

Reputation: 6064

When you're new to Chisel and Scala it can be a little intimidating, but I would suggest taking a look at the API docs and learning how to read them: https://www.chisel-lang.org/api/3.2.0/index.html

In this case, for Vec: https://www.chisel-lang.org/api/3.2.0/chisel3/Vec.html

Vec extends Scala Seq and thus has a massive assortment of useful methods like slice as discussed in the post Fabien linked.

Upvotes: 1

FabienM
FabienM

Reputation: 3761

I want to express Vec(0),Vec(1),Vec(2),Vec(3),Vec(4) together.Can I express it Vec(0->4) ?If it's error,what should I do ?

I think you are looking for a slicing function for Vec as plenn08 asked. Chick Markley gave a response for a slice assignement.

I have Digital Design with Chisel and chisel_cheatsheet.

That's a good start. You can also take a look at the chisel-bootcamp which can be done with a simple web browser.

Upvotes: 1

Related Questions