| package templates.m2m.hw |
| |
| import com.google.inject.Inject |
| import java.math.BigInteger |
| import org.eclipse.app4mc.amalthea.model.AmaltheaServices |
| import org.eclipse.app4mc.amalthea.model.Memory |
| import templates.AbstractAmaltheaInchronTransformer |
| import templates.utils.AmltCacheModel |
| |
| class MemoryTransformer extends AbstractAmaltheaInchronTransformer{ |
| |
| @Inject FrequencyDomainTransformer frequencyDomainTransformer |
| |
| public def create inchronmemoryFactory.createMemory createMemory(Memory amltMemory ){ |
| |
| val AmltCacheModel cacheModel=customObjsStore.getInstance(AmltCacheModel) |
| |
| |
| it.name=amltMemory.name |
| |
| it.clock=cacheModel.getInchronClock(amltMemory?.frequencyDomain?.name) |
| |
| var amltDataSize=amltMemory?.definition.size |
| |
| if(amltDataSize!==null){ |
| var bytes=AmaltheaServices.convertToBit(amltDataSize).divide(new BigInteger("8")) |
| |
| it.size=bytes.intValue |
| |
| } |
| |
| it.prescaler=1d |
| |
| //DataRate element is ignored |
| } |
| //TODO: set the right type of the Memory |
| } |