Corey Kosak Posted October 27, 2013 Report Share Posted October 27, 2013 Hi folks, I thought I'd share my second project with you all. I just bought this book and got some more ideas from it. I ended up making a little 16-element register file and wrapping a "user interface" around it. I filmed a little video, and I've also attached the source files. As I was doing this I noticed that the switches on the Papilio were not laid out in the order I expected. switch(0) is the leftmost when I expected it to be the rightmost. This is not a big deal--I could have RTFM'ed--but then I started thinking about how I wanted to deal with that. I might have edited my constraints file but I wanted to leave it alone. Instead I went looking for a way to reverse a logic vector in my design. I expected something like this to work:user_addr <= megawing_switches(0 to 3);user_data <= megawing_switches(4 to 7);But that gave me the error "Line 30: Slice direction does not match type range direction." So I ended up doing this, but I felt a little dirty.rewire: for i in 0 to 3 generate user_addr(i) <= megawing_switches(3-i); user_data(i) <= megawing_switches(7-i);end generate rewire;Is that really the simplest way to reverse a vector? I had another fun weekend here. Thanks again for listening! source.zip Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.