Component_shared()

Component_shared()

by Zacharie Serge Janek Mizeret -
Number of replies: 1

Hello, I don't really understand how component_shared is supposed to work. 

We are told to set the start and end to 0, which is fine but does that mean we should also reset the memory of the component then? Since once we give it a pointer to the new memory it will never remember it's old one? (so in a way should we do a "garbage collection"?)

Also we are told that the first component_t c should take the memory of component_t c_old, but in that case should we also give c the starting and ending adresses in the bus of c_old?

Thank you for any clarifications,

Zacharie Mizeret 

In reply to Zacharie Serge Janek Mizeret

Re: Component_shared()

by Cédric Hölzl -
In the project, we will have a component used to "simulate" the RAM of the gameboy, that component has a memory of a given size.
In the specifications, the RAM is accessible at two adresse-sets on the bus.
To be able to reproduce this specificity of the gameboy, we use "component_shared" to create a second RAM component that is pluged onto the bus at the second address set. Allowing us to have the same memory accessible at multiple adresses on the bus.

(Note: in reality second adress range is read-only, but we ignore this.)