Needed carriage return after last line.
The active mask should be registered, not memory unit input pins.