# Modeling a simple cpu

**URL:** <https://www.ruby-forum.com/t/modeling-a-simple-cpu/73758>\
**Category:** Ruby\
**Created:** [October 26, 2006, 9:52pm UTC](https://www.ruby-forum.com/t/modeling-a-simple-cpu/73758 "2006-10-26T21:52:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [October 26, 2006, 9:52pm UTC](https://www.ruby-forum.com/t/modeling-a-simple-cpu/73758/1 "2006-10-26T21:52:44Z")

</div>

i need to model the on board cpu of a satellite in order to mock running  
uploaded commands. basically i need to model the internal state and all  
incoming commands so i can determine register states at a given point in  
time.  
has anyone out there done something similar? and helpful libs?  
basically  
i’ll need something like

dmsp\_cpu = cpu{  
register ‘oax’  
register ‘oal’

```
 mem 0x55, :value => 0x2a39

 instruction 'oaxload' do |value|
   oax[value]
 end

```

}

etc.

regards.

-a

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [October 26, 2006, 11:02pm UTC](https://www.ruby-forum.com/t/modeling-a-simple-cpu/73758/2 "2006-10-26T23:02:51Z")

</div>

Ara.T.Howard wrote:

> ```
> mem 0x55, :value => 0x2a39
> 
> instruction 'oaxload' do |value|
> oax[value]
> end
> 
> ```
> 
> }

What platform? What’s the type of cpu? I _think_ Solaris/Sparc comes  
with something that will let you do this.

Regards,

Dan

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [October 27, 2006, 1:09am UTC](https://www.ruby-forum.com/t/modeling-a-simple-cpu/73758/3 "2006-10-27T01:09:11Z")

</div>

On 10/26/06, Ara.T.Howard [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ```
> mem 0x55, :value => 0x2a39
> 
> instruction 'oaxload' do |value|
> oax[value]
> end
> 
> ```
> 
> }
> 
> etc.

You might want take a look at RHDL ( [http://rhdl.rubyforge.org](http://rhdl.rubyforge.org) )

Phil
