create SATACON and use it in bist_tb
This commit is contained in:
parent
ddb9d52270
commit
d88b127abb
|
@ -0,0 +1,14 @@
|
|||
from migen.fhdl.std import *
|
||||
|
||||
from lib.sata.common import *
|
||||
from lib.sata.link import SATALink
|
||||
from lib.sata.transport import SATATransport
|
||||
from lib.sata.command import SATACommand
|
||||
|
||||
class SATACON(Module):
|
||||
def __init__(self, phy, sector_size=512, max_count=16):
|
||||
self.submodules.link = SATALink(phy)
|
||||
self.submodules.transport = SATATransport(self.link)
|
||||
self.submodules.command = SATACommand(self.transport)
|
||||
self.sink, self.source = self.command.sink, self.command.source
|
||||
|
|
@ -5,9 +5,7 @@ from migen.genlib.record import *
|
|||
from migen.sim.generic import run_simulation
|
||||
|
||||
from lib.sata.common import *
|
||||
from lib.sata.link import SATALink
|
||||
from lib.sata.transport import SATATransport
|
||||
from lib.sata.command import SATACommand
|
||||
from lib.sata import SATACON
|
||||
from lib.sata.bist import SATABIST
|
||||
|
||||
from lib.sata.test.hdd import *
|
||||
|
@ -19,14 +17,11 @@ class TB(Module):
|
|||
link_debug=False, link_random_level=0,
|
||||
transport_debug=False, transport_loopback=False,
|
||||
hdd_debug=True)
|
||||
self.submodules.link = SATALink(self.hdd.phy)
|
||||
self.submodules.transport = SATATransport(self.link)
|
||||
self.submodules.command = SATACommand(self.transport)
|
||||
self.submodules.bist = SATABIST(sector_size=512, max_count=1)
|
||||
|
||||
self.submodules.controller = SATACON(self.hdd.phy)
|
||||
self.submodules.bist = SATABIST(max_count=2)
|
||||
self.comb += [
|
||||
self.bist.source.connect(self.command.sink),
|
||||
self.command.source.connect(self.bist.sink)
|
||||
self.bist.source.connect(self.controller.sink),
|
||||
self.controller.source.connect(self.bist.sink)
|
||||
]
|
||||
|
||||
def gen_simulation(self, selfp):
|
||||
|
|
Loading…
Reference in New Issue