bluespec.com Forum Index bluespec.com
Bluespec Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Stack Implementation

 
Post new topic   Reply to topic    bluespec.com Forum Index -> Designing with BSV's Rules, Interfaces, ...
View previous topic :: View next topic  
Author Message
naddy88



Joined: 26 Aug 2012
Posts: 20

PostPosted: Thu Nov 21, 2013 12:18 pm    Post subject: Stack Implementation Reply with quote

Are there any Stack Primitives (LIFO) implemented in the Bluespec Library?
Back to top
View user's profile Send private message
quark
Site Admin


Joined: 02 Nov 2007
Posts: 500

PostPosted: Thu Nov 21, 2013 2:58 pm    Post subject: Re: Stack Implementation Reply with quote

No, there are no LIFOs in the library. If someone reading this has written one, though, feel free to post it here.
Back to top
View user's profile Send private message
[email protected]



Joined: 10 Sep 2010
Posts: 1

PostPosted: Tue Nov 24, 2015 6:19 am    Post subject: A LIFO implementation Reply with quote

I found this post looking for a stack. I've quickly written one myself, adapted from my FIFO implementations. There are a guarded and unguarded implementation. The size goes in the interface next to the data type of the lifo.

edit: I just tested this, and unfortunately this one only lets you fill to the size - 1. Otherwise it works. Using it unguarded should just wrap around, always giving you the <size> most recent pushes.



LF.bsv
 Description:

Download
 Filename:  LF.bsv
 Filesize:  3.08 KB
 Downloaded:  480 Time(s)

Back to top
View user's profile Send private message Send e-mail
odeyemis



Joined: 18 Oct 2014
Posts: 1

PostPosted: Wed Mar 02, 2016 1:17 am    Post subject: Reply with quote

How is it a stack if it only fills to a size of 1? Surely, you need at least two entries for the implementation to have any relevance.

In any case, the stack shouldn't be limited by size and should be capable of filling up indefinitely (up to the amount of available memory).

Surely, a stack implementation is possible since it is only a reverse of the FIFO.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    bluespec.com Forum Index -> Designing with BSV's Rules, Interfaces, ... All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
bluespec.com topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP